Progress on moving from Python 2 to Python 3 - training for both versions
Archive - Originally posted on "The Horse's Mouth" - 2015-12-01 07:33:23 - Graham EllisI find the progressing fron one major version of a language to another is often incredibly slow. But I suppose I shouldn't find it "incredible" because lifetime code maintenance and updates account for more time spent on a successfully appied piece of software that the original writing of it. And even with new code, there's often a requirement to use well established modules and tools which may not (yet) be available in the new environment, even though the new version of the language itself is available.
Furthermore, most new versions of existing successful languages don't really provide all that great an enhancement. The new facilities may be "nice", they may be "useful", they may "cure longstanding issues" and they may make it "neater", but we should not forget that the old version was a success - there wasn't much wrong with it, so the immediate need for an upgrade is marginal for many or even most of the existing users.
So it is that - five years or more on - I'm teaching Python and asking my delegates "will you be writing in Python 2 or Python 3" and the answer if often "Python 2". Than was the case on yesterday's private day where we majored on wxPython, and I have a public Python Programming course starting in about 2 hours which could be "biased" either way. Fortunately, the differences are small enough for the course to major one way or the other, and our group sizes (also small) lend themselves to this approach.
In practise, this upgrade (Python 2 to Python 3) is an odd one - it's possible (and recommended) to write code that's pretty similar / works exactly in both without too much effort - and I recommend that approach and teach it - and yet even "Hello World" can vary!
Python 2:
print "Hello World"
(see source [here]
Python 3:
print ("Hello World",end="\n")
(see source [here]
Or Python 2 AND Python 3:
print ("Hello World")
(see source [here]
Accommodation's full for tonight at our Well House Manor hotel ... but anyone who lives within an hour or so of Melksham would still be just in time to book on the course and commute. No - I don't exepect it to happen, but stranger things have. For the more conventional - see our schedule [here] for public courses in the New Year. For private courses, a few days remain available in the lead up to Christmas.