go!go!go!
全部博文(188)
分类: Python/Ruby
2013-01-23 19:44:51
#!/usr/bin/python import urllib,os,threading proxies={'http': ''} def processLine(line): print "child:",line while True: fin = urllib.urlopen(line,proxies=proxies) while True: fout=open('/dev/null', 'w') fout.write(fin.read(1024)) fileListName = '/tmp/filelist.conf' fileListFile = open( fileListName ) fileNames = fileListFile.readlines() fileListFile.close() for fileName in fileNames: if fileName[-1] == '\\n': fileName = fileName[0:-1] print "Father:",fileName processThread = threading.Thread(target=processLine, args=[fileName]) processThread.daemon = True processThread.start()