[Tutor] which version do i have and how do i change it

Jeremy G Clark jeremy.clark at ucr.edu
Tue Aug 16 20:27:32 CEST 2011


Yes, that's what I was trying to say.  Thanks for translating! :)

-----Original Message-----
From: Prasad, Ramit [mailto:ramit.prasad at jpmorgan.com] 
Sent: Tuesday, August 16, 2011 11:24 AM
To: Jeremy G Clark; tutor at python.org
Subject: RE: [Tutor] which version do i have and how do i change it

> I can't remember, you may need to chmod +x in order for this to work.  Anyone?

You need to chmod if you want to call the script via shebang (./script.py). If you are calling it by doing 'python3 script.py' then you do not need it as python3 should already be executable.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



-----Original Message-----
From: tutor-bounces+ramit.prasad=jpmorgan.com at python.org [mailto:tutor-bounces+ramit.prasad=jpmorgan.com at python.org] On Behalf Of Jeremy G Clark
Sent: Tuesday, August 16, 2011 12:59 PM
To: tutor at python.org
Subject: Re: [Tutor] which version do i have and how do i change it

@ Connor -- you probably should heed the advice of Alan and leave your existing Python 2.x install alone.  For the exercises in your book, you should be able to include this line at the top of every script and it'll work just fine.  I can't remember, you may need to chmod +x in order for this to work.  Anyone?

#! /usr/bin/python3

Or, use python3 to open the script from the command line: connor at linuxbox# python3 script.py This is how I test on my Ubuntu install.

-----Original Message-----
From: tutor-bounces+jeremy.clark=ucr.edu at python.org [mailto:tutor-bounces+jeremy.clark=ucr.edu at python.org] On Behalf Of Alan Gauld
Sent: Tuesday, August 16, 2011 9:07 AM
To: tutor at python.org
Subject: Re: [Tutor] which version do i have and how do i change it

On 16/08/11 10:14, Lisi wrote:
> On Tuesday 16 August 2011 09:05:44 Alan Gauld wrote:
> > You might need to ensure that you have at least 1 version of Python2
> around
> > because a lot of Linux tools are still written in v2 and might break
> if you
> > uninstall all v2 versions...
>
> Thanks for that, Alan.  I knew that I had Python 2 by default and did 
> not have to install it, but had not queried why.
It can be hard to tell, sometimes distro designers just think something is useful.
For example many Linux users nowadays have no use for gcc but it is usually packaged anyway.

> If it was already on the system , I wonder why the OP needed to 
> install it?

I suspect that the default was probably version 2.5 or 2.6 (My Ubuntu
10.04 has 2.6)
So if OP installed 2.7 it would be additional.

My concern was that if they uninstalled 2.7 the default would revert to
2.6 (or
whatever) and they might then be tempted to uninstall that too!

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list