How to call a file using python scripts in cygwin

I wrote a python script that calls the .exe file and runs it.

import subprocess
path = "C:\Tools\file.exe"
subprocess.Popen(path)

      

When I run my Python file on Windows it runs successfully, but when I try to run the same script in Cygwin it fails.

Can someone help me explain what is the command in cygwin to run the file?

+3


source to share


1 answer


Under Cygwin, you will find C: \ Drive under / cygdrive / c. You should try something like this:



import subprocess
path = "/cygdrive/c/Tools/file.exe"
subprocess.Popen(path)

      

+3


source







All Articles