Доброе утро! Не могу понять, почему зацикливается программа (Python 2.7, Windows 7 64-bit):
import threading,sys
from socket import *
class MyThread(threading.Thread):
def __init__(self, func, ip, port):
threading.Thread.__init__(self)
self.func = func
self.ip = ip
self.port = port
def run(self):
apply(self.func,(self.ip, self.port))
def Scan(ip,port):
sk = socket(AF_INET, SOCK_STREAM)
sk.connect((ip, port))
if getservbyport(port) != '' : print "[*] OPEN :",port," :: ",getservbyport(port)
sk.close()
def s():
print '\nStart'
for i in range(start,(end+1)):
MyThread(Scan,host,i).start()
host = sys.argv[1]
start = int(sys.argv[2])
end = int(sys.argv[3])
s()