Trying tcompile an use the Python 3.4a

Ned Batchelder ned at nedbatchelder.com
Wed Nov 13 12:29:38 EST 2013


On Wednesday, November 13, 2013 11:38:53 AM UTC-5, Ferrous Cranus wrote:
> Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε:
> 
> >> and also is there a way to call it like #!/usr/bin/python
> >
> > Of course there is, but only if you wish to break your system. The OS
> > will be expecting /usr/bin/python to be Python 2. Leave it be.
> 
> Okey i will leave it be although i dislike the idea of using the shebang 
> constructor as #~/usr/local/bin/python3
> 
> Is there any way that i can use it as it was #!/usr/bin/python but 
> firing python3 instead of python 2.6.6 ?

No, you can't.  "python" should mean Python 2.x.  If you want to use Python 3, invoke it as "python3".

BUT: you should have a good reason to switch to Python 3.  Your existing Python programs WILL NOT WORK with Python 3.  They will require porting from Python 2 to Python 3, and that is not always a simple task, especially when you are dealing with text, such as on a web site.

I strongly recommend that you stay on Python 2, and focus on other concerns.  "I want the latest Python" is probably not a good enough reason to switch.

--Ned.



More information about the Python-list mailing list