Oct-12-2022, 04:41 AM
Hi Gribouillis,
Superb ! your code worked ,
you are genius ! thanks for your help, you have saved my time.
Is there any other style way. I heard about multiprocessing\Multitreading\subprocess .run.
Superb ! your code worked ,
you are genius ! thanks for your help, you have saved my time.
Is there any other style way. I heard about multiprocessing\Multitreading\subprocess .run.
from pathlib import Path import sys this_dir = Path(__file__).parent for args in [ "add.py 10 20 30", "sub.py 40 20", "mul.py 2 2 2 2", "div.py 100 50"]: args = args.split() filename = this_dir/args[0] args[0] = str(filename) sys.argv[:] = args namespace = {'__name__': '__main__'} exec(filename.read_text(), namespace)