running python 2 vs 3

Michael Torrie torriem at gmail.com
Thu Mar 20 22:44:27 CET 2014


On 03/20/2014 11:10 AM, notbob wrote:
> On 2014-03-20, Zachary Ware <zachary.ware+pylist at gmail.com> wrote:
> 
>> If you're specifying the interpreter in your command (by calling
>> "python <scriptname>.py", etc), the shebang won't mean anything
>> anyway.
> 
> DOH!  
> 
> I was following you, fine, until that last sentence.  Then how should
> I invoke the scripts? ....as your example is exactly how I've been
> doing it with 2.7, as per Learn Python the Hard Way.  Simply
> ./<scriptname>.py from the appropriate directory (assuming I keep both
> vers in separate dirs)?'

If you want to run a script with python3, just invoke the python3
interpreter:

python3 blah.py




More information about the Python-list mailing list