-1
我有六個線程如何爲每個Python線程打開文件?
class ConsumerThread(Thread):
def __init__(self,queue):
super(ConsumerThread, self).__init__()
self.queue = queue
def run(self):
item = queue.get()
parser = MyHTMLParser()
new_con = parser.feed(item)
print(new_con)
queue.task_done()
我想把new_con到文件中,單個文件的一個線程。
你關心每個文件的命名嗎? –
使用「打開」功能?究竟是什麼問題?你有沒有想出獨特的文件名? –
@Rawing現在,我應該在哪裏放置開放以及如何獨立於線程? – MCB