[Python-porting] Shebang lines for Python 3

Lennart Regebro regebro at gmail.com
Mon Sep 5 07:32:56 CEST 2011


On Sun, Sep 4, 2011 at 21:07, Aaron Meurer <asmeurer at gmail.com> wrote:

> Hi.
>
> We've been having a bit of a discussion about this on the SymPy
> (sympy.org) issue tracker.  Is it proper to use "python3" in the
> shebang line of a script that should be run in Python 3?  Something
> like
>
> #! /usr/bin/env python3
>

It is proper, sure.

This shortcut works on my machine, but I don't know if it's universal
> to all Python 3 installs.


I know archlinux uses just "python" for Python 3 and "python2" for Python 2.
In general any install mechanism for your script should handle that, by for
example using distutils or something.

//Lennart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20110905/56a0a597/attachment.html>


More information about the Python-porting mailing list