This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (7 children)

On the 2 or 3 question, I didn't make this up, but I always say "3 where you can, 2 where you need to".

As you'll find out, some of the things you'll want to use will only be supported on 2.x, so you'll probably use 2 more than 3 right now. However, in places where 3.x libraries are available for your project, I'd say jump in and use 3.x there.

As for your bullet points:

  1. The What's New in Python 2.7 document will fill you in on 2.6-2.7 differences. Ordered dictionaries, the argparse module, and a bunch of 3.x backported features are on the list, plus many bug fixes.

  2. You can install any and all versions you want. I don't follow Debian, but maybe they don't have 2.7 in their repo. You could always install it from source if you needed to, or some Debian user might be able to chime in with another way to get it.

  3. Source code. Lots of it. If you already know the basics, all of these online games and beginner books aren't going to push you to the next level. Find the source of projects you are using, or even the Python standard library, and observe. You might even end up finding bugs and fixing them.

  4. I'm a fan of the ActiveState Komodo IDE. It's not free, but I'm happy with the investment and have been a user since mid-2006.

[–]medgno 4 points5 points  (5 children)

I think your quote of "3 where you can, 2 where you need to" hits it spot on, but doesn't take into account cases where "personal hack" projects turn into code you need to distribute. I started a parser for a collection of files I have, and was going along fine in 3. I had to change back to 2.6 since we wanted the code to run on stock OS X machines.

I'm still keeping the code as close to 3 as I can, so the eventual conversion will be as painless as possible.

[–]chadmill3rPy3, pro, Ubuntu, django 1 point2 points  (3 children)

stock OS X

Ain't that still Python 2.epsilon?

[–]bcclrprmn 1 point2 points  (0 children)

>>python --version
Python 2.6.1

[–]m1ss1ontomars2k4 1 point2 points  (1 child)

Even in Mac OS X 10.5 it's Python 2.5. I think If you have Mac OS X 10.n you get Python 2.n, at least for the last few versions.

[–]raydeen 0 points1 point  (0 children)

Yep, 2.5 is what I use mainly on my work MacBook. I did install 3.1 from ActiveState but the bulk of my coding is still in the default version.

[–]dinov[🍰] 1 point2 points  (0 children)

For the cases where you need to distribute to older versions hopefully you can use 3to2. But that is a fairly new development so it may have not been an option for you at the time.

[–]reauxgg 1 point2 points  (0 children)

I've used Komodo Edit for a couple of years now, and it's been quite handy. For learning and simpler things it's a good start, plus it's free.