What version of python to download

  • (2 Pages)
  • +
  • 1
  • 2

26 Replies - 2827 Views - Last Post: 24 December 2010 - 08:09 AM Rate Topic: -----

#1 BuhRock  Icon User is offline

  • D.I.C Regular

Reputation: 10
  • View blog
  • Posts: 256
  • Joined: 21-February 10

What version of python to download

Post icon  Posted 21 December 2010 - 01:51 AM

Hey everyone, I have decided to start learning python. I have had 3.0 downloaded on my computer for a month now, just never got around to it. Anyways, I was looking through some tutorials and tried a simple print statement, but the shell wasn't accepting it.

I tried print 'hey' and print "hey" and it gave me incorrect syntax both times. Is there something I'm doing wrong? Also, what version should I download. I have read that 2.7 is better than 3.0 as of now? Please don't think I'm stupid but I am just trying to get some information.

This post has been edited by atraub: 22 December 2010 - 08:50 AM


Is This A Good Question/Topic? 2
  • +

Replies To: What version of python to download

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 21 December 2010 - 05:04 AM

In python 3 print became a function. The new syntax is

print("hey")


Notice the parenthesis.

There are more modules available for 2.7 but that's not as big of a deal anymore because 3's been out for a while. Unless there's a specific reason you want to use python 2, id say stick with 3. The syntax differences are marginal and they won't support python 2 forever.

This post has been edited by atraub: 21 December 2010 - 07:43 AM

Was This Post Helpful? 0
  • +
  • -

#3 BuhRock  Icon User is offline

  • D.I.C Regular

Reputation: 10
  • View blog
  • Posts: 256
  • Joined: 21-February 10

Re: What version of python to download

Posted 21 December 2010 - 04:24 PM

Does Python usually do this? I don't think I'd like to learn a language that was changing that stuff around all the time.
Was This Post Helpful? 0
  • +
  • -

#4 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 21 December 2010 - 04:39 PM

Python3 is a radical shift from python2 rebuilt from the ground up. It's considered a different language by some. This is the first huge change like thi from python.
Was This Post Helpful? 0
  • +
  • -

#5 Guest_c.user*


Reputation:

Re: What version of python to download

Posted 21 December 2010 - 04:46 PM

BuhRock, many books are rewriting now from python 2 to python 3
print of python3 is more powerful than in python2

This post has been edited by c.user: 21 December 2010 - 04:53 PM

Was This Post Helpful? 0

#6 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: What version of python to download

Posted 21 December 2010 - 09:26 PM

I'd learn using version 2.x there are MUCH more libraries available for that version.
Was This Post Helpful? 1
  • +
  • -

#7 BuhRock  Icon User is offline

  • D.I.C Regular

Reputation: 10
  • View blog
  • Posts: 256
  • Joined: 21-February 10

Re: What version of python to download

Posted 22 December 2010 - 02:47 AM

Edit: I took a look at the python resource thread.

This post has been edited by BuhRock: 22 December 2010 - 02:51 AM

Was This Post Helpful? 0
  • +
  • -

#8 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 22 December 2010 - 05:44 AM

You really don't need a ton of additional libraries to learn the core semantics of a language though.
Was This Post Helpful? 0
  • +
  • -

#9 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: What version of python to download

Posted 22 December 2010 - 05:50 AM

You'll hit a wall eventually where you'll need libraries to handle your basic things. Why set yourself up for hurt in the long run?
Was This Post Helpful? 0
  • +
  • -

#10 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 22 December 2010 - 07:17 AM

I'm so glad you asked:

1.) I have never once found myself needing a library that py3 didn't have. I do hope it'll get py2exe eventually, but truthfully that's not a big deal to me since I mainly work in Linux. If you really want to use some obscure library, just run the 3 to 2 conversion tool or bundle your script with portable python.

2.) If everyone were to follow that line of thought, new languages (or whatever you'd call py3) would never take off. Don't be afraid of change, embrace it.

3.) 2.7 is it. It's the end of life release. There will be no major updates. 3.x is still under active development which means you will still see improvements as time goes on.

4.) Py3 does have some notable improvements. Look at print; print is a function and has a little more power now. For example:
print(value, end=" ")

This is a far more intuitive statement than:
print value,

And making print a function just makes more sense. Don't misunderstand, there are other improvements that just make more sense now, like the underlying changes to range. It also removed the old functionality on input which removed a huge security flaw.

That seems good for a start. Tell me Sergio, what vital library do you feel that py3 needs for you to get behind it? I'm sure you could google and find some stuff, but I want to know about a time where you've found py3 to be too limited for your needs.

This post has been edited by atraub: 22 December 2010 - 08:21 AM
Reason for edit:: expansion!

Was This Post Helpful? 0
  • +
  • -

#11 blutrane  Icon User is offline

  • 私もクールです

Reputation: 26
  • View blog
  • Posts: 1,934
  • Joined: 17-May 01

Re: What version of python to download

Posted 22 December 2010 - 07:47 AM

Starting with 2.x to me sounds reasonable as 3.x hasn't been totally embraced by everyone and knowing 2.x gives the programmer a perspective as to why print became a function and why raw_input in 2.x is input in 3.x and so on.

Although it is a 'radical shift' from 2.x to 3.x, learning one and neglecting the other is foolhardy because not everyone has migrated to 3.x, at least for the time being until the world has for the most part left 2.x behind
Was This Post Helpful? 0
  • +
  • -

#12 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 22 December 2010 - 07:50 AM

Learning one and not the other? The syntax differences are marginal. Converting code from one to the other is an easy practice.

This post has been edited by atraub: 22 December 2010 - 08:08 AM

Was This Post Helpful? 0
  • +
  • -

#13 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: What version of python to download

Posted 22 December 2010 - 08:25 AM

View Postatraub, on 22 December 2010 - 09:17 AM, said:

That seems good for a start. Tell me Sergio, what vital library do you feel that py3 needs for you to get behind it? I'm sure you could google and find some stuff, but I want to know about a time where you've found py3 to be too limited for your needs.


BeautifulSoup.

That thing is PARAMOUNT to my work in Python and having it Just Work™ in Python 2.x is wonderful.

This post has been edited by Sergio Tapia: 22 December 2010 - 08:25 AM

Was This Post Helpful? 0
  • +
  • -

#14 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: What version of python to download

Posted 22 December 2010 - 08:28 AM

Haha, well if he needs to do some HTML parsing, you're right py2 is the way to go for now. I'll admit I have never needed or desired to do that. Still doesn't change that anyone could run 3to2 if they really needed to use a module like that one.

This post has been edited by atraub: 22 December 2010 - 08:43 AM

Was This Post Helpful? 0
  • +
  • -

#15 blutrane  Icon User is offline

  • 私もクールです

Reputation: 26
  • View blog
  • Posts: 1,934
  • Joined: 17-May 01

Re: What version of python to download

Posted 22 December 2010 - 08:44 AM

View Postatraub, on 21 December 2010 - 04:39 PM, said:

Python3 is a radical shift from python2 rebuilt from the ground up. It's considered a different language by some. This is the first huge change like thi from python.



View Postatraub, on 22 December 2010 - 07:50 AM, said:

Learning one and not the other? The syntax differences are marginal. Converting code from one to the other is an easy practice.


Precisely... A large portion of the market that codes using python still uses 2.x. I say start with 2.x, you learn the 'core semantics,' the libs and have a deeper appreciation for the changes that were made in 3.x and those to come since 3.x is still under development. Not only are already familiar with both major releases that are used, you understand the direction of development and why the changes were made. It is different than telling someone to go learn BASIC first before proceeding to VB.NET, because they are quite a bit different, that would be a detriment in my opinion.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2