#coding=utf-8
import os
from gevent import monkey,pool
monkey.patch_all()
import gevent
import time
p=pool.Pool(5)
print time.strftime('%H:%M:%S')
f=open('d:\\fps.txt','r')
wt=open('d:\\fps.html','w')
readline=f.readlines()
ar=[]
for i in readline:
ar.append(i.replace('\n','')) f.close()
wt.write('<html><body>')
def write_to(u):
for lists in os.listdir(u): #WindowsError: [Error 3] : 'u:\\\xe5\x86\x85\xe9\x94\x80\xe7\xb3\xbb\xe5\x88\x97\\W/*.*'...........<Greenlet at 0x63004e0: write_to('u:\\\xe5\x86\x85\xe9\x94\x80\xe7\xb3\xbb\xe5\x88\)> failed with WindowsError
path = os.path.join(u, lists)
wt.write(path) ''' wt.write('<a href="%s">%s</a><br/>'%(path,lists[:-4]))
for u in ar:
p.spawn(write_to,u)
''' tasks=[p.spawn(write_to,u) for u in ar]
gevent.joinall(tasks) wt.write('</body></html>')
print time.strftime('%H:%M:%S')
del ar
wt.close()