I have a script that opens a file using subprocess.Popen so I can run it in the background. I would like to be able to run this script with ./[script] [params]
#!/usr/bin/python
import subprocess
import sys
sys.path.insert(0,"./pyqt")
import gui
if __name__ == "__main__":
subprocess.Popen(["python", "./pyqt/gui.py"])
gui.py can take parameters when being ran from a terminal by using sys.argv. Below is how I am accessing these params in gui.py
def main(*args):
print(args)
if __name__ == "__main__":
main(sys.argv)
How can I pass sys.argv into subprocess.Popen?