0

I have created a dedicated Python interpreter in Windows called nPython.exe. It is a Python 2.7 interpreter, using Python.NET sources of pythonnet-develop.

I have a specific module. I want this module to always be executed by nPython.exe. The module is executed in many different ways: double clicking the module, or using Visual studio, or as part of existing scripts.

I thought using a shebang line at the beginning of the file (i.e. #!C:\dir\nPython.exe) might work, but unfortunately I had no success.

Note, I don’t want to overwrite the python.exe all users have as part of the standard Python installation.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
R.Shabtai
  • 81
  • 7
  • Shebangs with paths aren't used in Windows – OneCricketeer Dec 31 '15 at 17:44
  • Install Python 3 to get the [py launcher](https://docs.python.org/3/using/windows.html#python-launcher-for-windows). Then you can use a shebang, exactly like you want. Or just define a new filetype and association, e.g. `ftype nPython.File="C:\dir\nPython.exe" "%1" %*` and `assoc .npy=nPython.File`. Then just use the .npy filename extension for nPython scripts. – Eryk Sun Dec 31 '15 at 23:27

0 Answers0