amol kulkarni amol kulkarni - 4 years ago 87
Linux Question

Subprocess.Popen error

Proc = subprocess.Popen ([ 'FileName'])

The FileName is a variable which stores "/home/USER/ &", the program searches for the file in the home folder and stores the path in FileName.I am unable to start this process.It gives me the following error

OSError: [Errno 2] No such file or directory

I initially used::


It worked perfectly but didn't return the pid. Thus, I switched to Popen.

Answer Source


fileName = "/home/USER/"
proc = subprocess.Popen(fileName)
pid =
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download