import threading
import time
g_ip_addr = ["192.168.1.1",
"192.168.1.2",
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",
"192.168.1.6",
"192.168.1.7",
"192.168.1.8"]
class update_hg(threading.Thread):
def __init__(self, ip_addr):
threading.Thread.__init__(self)
self.ip_addr = ip_addr
def run(self):
while 1:
print 'ip_addr = %s\n' %(self.ip_addr)
time.sleep(180)
if __name__ == '__main__':
for ip_addr in g_ip_addr:
update_hg(ip_addr).start()