Say I want to run an executable with a filename argument that is within my working directory, in Windows cmd I would go:
C:\Python27\python signalme.py
How can I do so in Cygwin? NOTE: C:\\Python27\\python is an executable. Please give me a full answer, I read somewhere here that you should add a .\\a
, but I couldn't know where to add it.
Cygwin attempts to make a Linux-like user environment available on Windows. To run a executable file on a Linux-like command line, you need the following things:
So, to run an executable in your working directory, you can specify the relative path to the working directory, along with the filename: ./foo.exe
.
In your case, you want to use the Python interpreter to run a local Python file. You will most likely need to use the Cygwin-installed Python. That Python will probably be in your PATH, so just run:
python signalme.py
This could fail, with an error message like bash: python: command not found
- in which case you should re-run your Cygwin setup, look for the opportunity to install Python, and make sure you install it.
/cygdrive/c/python27/python.exe signalme.py
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.