From a windows application written on C++ or python, how can I execute arbitrary shell commands?
My installation of Cygwin is normally launched from the following bat file:
@echo off
C:
chdir C:\cygwin\bin
bash --login -i
From Python, run bash with os.system
, os.popen
or subprocess
and pass the appropriate command-line arguments.
os.system(r'C:\cygwin\bin\bash --login -c "some bash commands"')