"py" command for Linux and Mac?

Chris Angelico rosuav at gmail.com
Fri May 20 21:50:06 EDT 2022


On Sat, 21 May 2022 at 11:22, Michael Torrie <torriem at gmail.com> wrote:
> And of course the answer given by the grandparent is that Dan should use
> a normal linux shebang line in his scripts and on Windows the py
> launcher will read that shebang and guestimate the proper python
> interpreter to use and execute the script with that. Thus if I'm reading
> this correctly, a Linux shebang line should function as expected on
> Windows when python files are associated and launched with the py.exe
> launcher, even though there's no such thing as /usr/bin/python3 on
> Windows.  Py launcher makes it work as if there was.
>

That's correct, and when the py.exe launcher was first, well,
launched, the main thrust of it was "it uses the shebang that you
already include for the sake of Unix systems". You don't need extra
directives to tell it what to do.

ChrisA


More information about the Python-list mailing list