What meaning is of '#!python'?

Zachary Ware zachary.ware+pylist at gmail.com
Sat Nov 14 21:26:50 EST 2015


On Sat, Nov 14, 2015 at 7:58 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Sun, Nov 15, 2015 at 12:54 PM, fl <rxjwg98 at gmail.com> wrote:
>> I see an example Python code has such a line at the file beginning:
>>
>> #!python
>>
>>
>> Is there some meaning about it?
>
> It probably didn't look exactly like that. Please, when you're asking
> questions, COPY AND PASTE rather than retyping some approximation of
> what you saw.

"#!python" is a valid shebang for the Python Launcher for Windows.
It's also a not-too-terrible placeholder for a Unix shebang meaning
"whichever Python you want it to be".  The better choice for use with
both platforms would be "#!/usr/bin/env python", though.

-- 
Zach



More information about the Python-list mailing list