OpenTechSchool / python-beginners

Workshop material for "Introduction to Programming with Python"
http://opentechschool.github.io/python-beginners/
175 stars 253 forks source link

Specify Python version #19

Closed lehmannro closed 8 years ago

lehmannro commented 11 years ago

I know we have discussed this already but I cannot remember what we agreed upon: Do we use Python 2 or Python 3? We should advertise that somewhere.

In case we settle on Python 2, all prints should use the statement form.

nekopanic commented 11 years ago

We have been using Python 2, but some people come with a pre-install of Python 3.

Anyway, I think we can just use print() to keep compatibility. I'm pretty sure nobody cares if a Python 2 program uses print() these days.

lehmannro commented 11 years ago

I know beginners couldn't care less but technically, print as a function is wrong — if not explicitly enabled by a __future__ import — in Python 2. It's especially harmful if one uses print(x, y) which, in Python 2, prints a tuple but is basically two prints in Python 3.

While perhaps not forcing learners to use Python 3 (or should we?) we should explicitly state which Python version we target for other coaches.

Ivoz commented 11 years ago

I feel we should be spear-heading beginners into the future, and try to teach python 3 wherever possible.

And for the difference signatures of the print function, I don't think that will hit many absolute-beginners who probably wouldn't the full mechanics of how it works anyway.

SonOfLilit commented 11 years ago

I personally want to teach my students something useful today that you can find lots of answers for on the interwebs, so I'll teach python2. I also fear that most will come with python2 pre-installed and having to explain the difference and convince them to install python3...

Ivoz commented 11 years ago

If Django supports it, I consider python3 production ready. I feel bad teaching people tech that been succeeded 5 years ago now, plus we're helping to keep python2 around when it needs to die! Most packages not supporting python3 aren't really being maintained any more.

Python3 also comes with the nice windows feature of letting you add it to the path when you install it, its not checked by default but its easy enough to note.

I've really seen the opposite - for new people, if people have preinstalled python they've usually "naively" selected version 3, being the newest.

SonOfLilit commented 11 years ago

ActiveState python adds itself to the path. It also comes with pip and easy_install, which are a nightmare to install separately, so I strongly recommend my students to use it.

Maybe the tutorial should recommend it?

All this is also true of Anaconda, but it's a much bigger download.

SonOfLilit commented 11 years ago

I was surprised to see how much forward python3 support is (pywin32! I was betting on that one winning the case!), so I went here to look more closely:

http://python3wos.appspot.com/

Here are some red packages that I've used or my students have used in the last year:

Fabric (you know where :-) ) MySQL-python paramiko suds django-celery django-debug-toolbar django-nose python-ldap

There's also Twisted, that I don't remember using but everyone else does.

These are just >250Kdownloads packages.

So sorry, I'll wait a year or two.

Ivoz commented 8 years ago

I hope it's pretty clear we want to teach newcomers Python 3 now. It's made a lot of progress and continued with 3.5 :D Cheers