Cygwin: To use Windows Python in shebang

Create a bash script as a proxy:

Filename wpython save it some where in your $PATH

# remove the first argument
python.exe $(cygpath -w $path) [email protected]  

Now, we can use this shebang:

#! /usr/bin/env wpython

The code will convert Cygwin path back to Windows path, and thus compatible with Windows Python.

Konpat Preechakul

Read more posts by this author.