Multithreaded file read python
问题 import threading def read_file(): f = open('text.txt') for line in f: print line.strip() ,' : ', threading.current_thread().getName() if __name__ == '__main__': threads = [] for i in range(15): t = threading.Thread(target=read_file) threads.append(t) t.start() Question: Will each thread read each line only once from the file above or there are chances that a given thread can end up reading a line twice? My understanding was that a thread started later will overwrite the file handle for the