Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'python3': 0.07; "'python": 0.09; 'indicates': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '2.7': 0.14; 'language.': 0.14; 'windows': 0.15; '.py': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:peps': 0.16; 'subject:python': 0.16; 'files.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'header:User- Agent:1': 0.23; '2.x': 0.24; 'url:dev': 0.24; 'initial': 0.24; '---': 0.24; "i've": 0.25; 'script': 0.25; 'tutorials': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'run': 0.32; 'linux': 0.33; 'url:python': 0.33; 'skip:# 10': 0.33; 'but': 0.35; 'idle': 0.36; 'next': 0.36; 'url:org': 0.36; 'expected': 0.38; 'convention': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'tell': 0.60; 'free': 0.61; 'till': 0.61; 'visa': 0.61; 'viruses': 0.61; 'protection': 0.63; 'our': 0.64; 'box,': 0.64; 'different': 0.65; 'fire': 0.65; 'within': 0.65; 'between': 0.67; 'antivirus': 0.68; 'default': 0.69; '2.7.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: running python 2 vs 3 Date: Thu, 20 Mar 2014 18:56:25 +0000 References: <87ob10nbeh.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-8-179.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <87ob10nbeh.fsf@elektro.pacujo.net> X-Antivirus: avast! (VPS 140319-1, 19/03/2014), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395341804 news.xs4all.nl 2946 [2001:888:2000:d::a6]:57127 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68598 On 20/03/2014 15:21, Marko Rauhamaa wrote: > notbob : > >> I've installed python 3.3 on my Slack box, which by default comes with >> python 2.7. I know how to fire up the different IDLE environments, but >> how do I differentiate between the scripts? IOW, up till now, I've >> used .py on all my 2.7 files. How do I know not to run a .py in >> python3 or visa versa? Or do I? What's the excepted convention for >> differentiating between the two? > > 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. > > > Marko > The above is also true on windows via the 'Python launcher for windows' see http://legacy.python.org/dev/peps/pep-0397/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com