Photo by Shahadat Rahman on Unsplash

Python 2.7 and Python 3.8 … the Siblings That Never Got On With Each Other

With Repl.it, it has never been easier to convert

--

Well, as some people are Spring cleaning, I’ve been busily doing my own Spring cleaning, and upgrading 100s of my old Python 2.7 scripts on my Web site [here]. Last Thursday was the last Python 2.7 release (Python 2.7.18), and then that will be it.

So, I have upgrade, or my students will complain that they can’t get their crypto scripts to work. Along with this, much of the new code is matched to Python 3, and won’t work with Python 2.

Python was created by Guido van Rosum, and, in 2006, he defined a new standard as PEP (Python Enhancement Proposal) 3000. Overall, Python Version 2 had been around since 2000, and based on PEP 3000, Version 3 came along in 2008. But they never really got on with each other. Version 3 just didn’t like the way that Python 2 was a bit all over the place with its data types and in the loose way of doing string manipulations. The two were just not going to be compatible! For some programs, it was the easy conversion of:

print "Hello world. I am "+name

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.