Shebang or Hashbang for modules or not?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Apr 11 18:24:12 EDT 2007


Chris Lasher a écrit :
> Should a Python module not intended to be executed have shebang/
> hashbang (e.g., "#!/usr/bin/env python") or not?

The shebang is only useful for files that you want to make directly 
executable on a *n*x system. They are useless on Windows, and not 
technically required to use the file as a main program  -ie: you can 
always run it like this:
$ /path/to/python filename.py

> I'm used to having a
> shebang in every .py file

An encoding declaration might be more useful IMHO !-)



More information about the Python-list mailing list