Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call a file through Python scripting on cygwin

I have written a python script which calls a .exe file and run it.

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

When I execute my Python file on windows, it run successfully but when I try to run the same script on Cygwin, it does not execute.

Can some one help me telling what is command on cygwin to run a file??

like image 224
user2033758 Avatar asked Feb 17 '26 08:02

user2033758


1 Answers

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

import subprocess
path = "/cygdrive/c/Tools/file.exe"
subprocess.Popen(path)
like image 92
Holger Avatar answered Feb 19 '26 07:02

Holger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!