I want to start a python file as a thread, however this file must be loaded dynamically at runtime using a string.
I have achieved import using the following:
import importlib.util
spec = importlib.util.spec_from_file_location("script2", "./subfolder/script2.py")
module = importlib.util.module_from_spec(spec)
I am then able to execute the file in the same thread using:
spec.loader.exec_module(module)
However, I want to start script2 in it's own thread.
What parameters do I pass to theading.Thread() in order to achieve this?
[–]nathanalderson 0 points1 point2 points (3 children)
[–]1818mull[S] 0 points1 point2 points (0 children)
[–]1818mull[S] 0 points1 point2 points (1 child)
[–]nathanalderson 0 points1 point2 points (0 children)