How to write code that works on both Python 2 and Python 3?

Published: 09 October 2017
on channel: Real Python
2,658
48

https://dbader.org/python-tricks ► New features available in Python 3 that let you write better code

Python question from a reader:

"How to write code that works on both Python 2 and Python 3?"

We'll discuss backwards compatibility in the Python world and the "six" module you can use to write code that works on Python 2 and Python 3 unmodified. Hopefully this will make the age-old "Python 2 vs Python 3" decision a little easier for you.

Got a question? Leave a comment with your Python or general software dev question on this video and I'll try to cover it question in one of the next "#PythonQ&A" videos.

Full playlist here:    • Python Q&A with Dan – Your Python/Car...  

FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery

SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube

* * *

► Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com

► PythonistaCafe – A peer-to-peer learning community for Python developers: https://www.pythonistacafe.com

FREE Python Coding Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter:   / @dbader_org  
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube


Watch video How to write code that works on both Python 2 and Python 3? online, duration hours minute second in high quality that is uploaded to the channel Real Python 09 October 2017. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,658 times and liked it 48 visitors.