Python3 changes | SoloLearn: Learn to code for FREE!

+3

Python3 changes

Python gurus: I’m trying out python code from what seem to be python 2 examples. Is there a quick way to check what’s changed between versions and how to quickly adapt python2 code to work with python3? I’m trying urllib for scraping web page data but I’m finding that it doesn’t have the functions that the sample code is using.

6/3/2018 12:16:03 AM

Umair Salam

3 Answers

New Answer

+4

This link seems pretty complete: http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

+3

Thank you Pedro :) I'm finding that aside from the Python3 & older version differences, there are newer versions of popular libraries that you have to update the code for as well :) Gives me the same feeling as when I used to do Java development and constantly have to read documentation for new updates when older code got deprecated...fun times :)

0

Don't worry Umair Salam. Although updates can be painful, they are for the best. Indeed, Python 3 has incredibly powerful features that Python 2 simply does not have. So the effort is worthwhile. Even performing smaller updates, like from Python 3.7 to Python 3.8, is not so fun in the beginning, but after trying out all the new stuff, one does not regret it. I am quite thankful that Python has been getting better and better, and that great developers are working for it to be even more awesome, which always seems impossible :) But they always surprise me. Happy coding!