Jun-10-2019, 07:59 PM
Hi,
I'm trying to create a multithreaded file read. Which has to read multiple files to different lists which further in the code will have to be handled. But I'm not able to get this code running without having a traceback call.
I also tried to call different def functions, but that's not working also. The function keeps the thread locked before continuing to the next.
( If this is a newby question I sorry, that's what I am.
)
Any hints on how to achieve this?
I'm trying to create a multithreaded file read. Which has to read multiple files to different lists which further in the code will have to be handled. But I'm not able to get this code running without having a traceback call.
I also tried to call different def functions, but that's not working also. The function keeps the thread locked before continuing to the next.
( If this is a newby question I sorry, that's what I am.

Any hints on how to achieve this?
from concurrent.futures import ThreadPoolExecutor with ThreadPoolExecutor(max_workers=4) as e: e.submit(ArtLev = list(open(ArtLev_filename, encoding='ANSI'))) e.submit(ArtPrijs = list(open(ArtPrijs_filename, encoding='ANSI')))
Error:Traceback (most recent call last):
File "C:/Users/danie/OneDrive_MLM/OneDrive/Daniel/PyScripts/MultiThread/MultiProcess_FileMatch_test1.py", line 127, in <module>
e.submit(ArtLev = list(open(ArtLev_filename, encoding='ANSI')))
TypeError: submit() missing 1 required positional argument: 'fn'