Recently, I ran into some trouble with a program for Steam that I was modifying that was written in Python 2. I had to change the old Python 2 code throughout the program. That can be long and tedious changing the syntax throughout the program. Luckily Python 3 comes prepackaged with a built in module just for that function.

The 2to3 standard module is just that module

run in terminal to convert Python 2 code to Python 3:

2to3 -w -n /Users/joshosborne/Documents/example/

“-w” denotes to overwrite the original file with the changed file.

If you don’t use  “-w” as an argument, it will just print what it will change.

“-n” denotes to not save a backup of the original file being modified.

You can pass any number of arguments found in the 2to3 documentation. But, more than likely, you will use these commands the majority of the time.

Leave a Reply

Your email address will not be published. Required fields are marked *


1 2
July 28th, 2019

Well… That’s It… Time to Take a Break

“God gave man life, and God gave him woman to make his life miserable.” It’s a pretty true quote. I […]

September 4th, 2017

Lessons Learned: A Story of Past Relationships

I have loved and lost many times before. I’ve gotten into toxic relationships and luckily gotten out of them, I […]

September 4th, 2017

Why Going to a Top-Ranked School Isn’t Necessarily a Good Idea

Shortly after transferring to a top-ranked public university, considered a public Ivy League, from a far less ranked university in […]

December 15th, 2016

Why Our Current Calendar Dating System is Dumb and Here is What is Better

The current calendar system structure was adapted centuries ago. A lot has changed since then, the world is round, we […]

August 4th, 2016

Kali Linux Command Cheat Sheet, Something Every Pentester and Hacker User Should Have

A apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian) aptitude Search for and […]

July 30th, 2016

Digital currency of the future?!

  Eventually the world economy will become so intertwined and digitized that you will pay for goods and services in […]

July 24th, 2016

What Does the Different Colors in the Terminal Mean (on Linux)?

Blue: Directory Green: Executable or recognized data file Sky Blue: Linked file Yellow with black background: Device Pink: Graphic image […]

December 24th, 2015

Why “Shutting Down” NASA Could Have Been the Best Thing to Happen to Space Travel

Space travel has historically been a very inefficient process. They shoot up these massive titanic rockets to lift off a […]

December 24th, 2015

UPDATE – Project: Steam Market Bot

I ran into some snags. The code is written by someone in Portugal and it is not written in the […]

December 22nd, 2015

Project: Steam Market Bot

  This project is currently in the concept phase and I hope to make regular updates on it’s progress. This […]