windows - Run python on Cygwin using batch file -


i know how create batch file execute python on cygwin please

tried 2 methods

method 1:

cd c:\cygwin64\bin  bash --login -i  python /home/xxxxx/snmptest.py 

method 2:

cd c:\cygwin64\bin  bash --login -i  /bin/bash.exe /home/xxxxx/snmp.sh 

the bash file contains

#!/bin/bash python /home/xxxxx/snmptest.py 

both fails run python script i.e. opens cygwin window.

in method 2, execute bash file on cygwin , python script running.

any thoughts on how accomplish after please?

thanks

here's batch file run on windows execute shell script named "my_shell_command" runs in cygwin:

export home="/cygdrive/c/cygwin64/home/$username" export path="$home/bin:/usr/bin:$path" . .bash_profile  dir="$( cd "$( dirname "${bash_source[0]}" )" && pwd )" dir="c:${dir#/cygdrive/c}"  my_shell_command  if (( $? == 0 ))     sleep 2 else     echo "" >&2     echo "hit \"enter\" when done reading above error/warning messages." >&2     read resp fi 

it stored on desktop in file named "my_shell_command.bash" , in windows have "bash" extension set "open with" bash.exe can double click on batch script execute shell script windows.

hopefully that's you'll need modify work you.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -