Originally I had two scripts main.py
and call_main.py
They were in the same level.
In call_main.py
I had
import subprocess
cmd = [
"python3",
"main.py",
]
subprocess.run(cmd)
No problem there.
However now I am moving the call_main.py
script two levels deeper to a folder /tools/mytools/call_main.py
How should I modify the script to be able to call main.py
?
In the beginning I tried changing the call to
import subprocess
cmd = [
"python3",
"../../main.py",
]
subprocess.run(cmd)
and changing any parameters that I call accordingly,
However it seems main.py
call other scripts so when I do the above way, it cannot file some imports it does.
So any good way to be able to run main?