Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: notbob Newsgroups: comp.lang.python Subject: Re: running python 2 vs 3 Date: 20 Mar 2014 16:00:07 GMT Lines: 29 Message-ID: References: <87ob10nbeh.fsf@elektro.pacujo.net> X-Trace: individual.net P1/kvIficf5OItV3i6aXPgtsmf6EzXkUdir9zoCFu0Gzkm8heA Cancel-Lock: sha1:wWfcW1yndyghhgF1FoT9B3jzZqc= User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:68584 On 2014-03-20, Marko Rauhamaa wrote: > That's a bit of a sore spot. > > On a linux box, the initial line of the script indicates the > interpreter: > > #!/usr/bin/env python2 > > for Python 2.x > > #!/usr/bin/env python3 > > for Python 3.x. > > All tutorials will tell you to start it with > > #!/usr/bin/env python > > which will start python2 on all (?) existing linux distros, but is > expected to start python3 within the next decade. Ahhh! ....now a shabang I understand. So, I guess the only way, short of looking at the actual file, is to include the version in the filename. Can I safely assume I can run all 2.7 files w/o a shebang (which I have not, so far, and was wondering how I got away with that) and only include a py3 shebang in the py3 files, yes/no? nb