Skip to content

Instantly share code, notes, and snippets.

@GenevieveBuckley
Created April 30, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GenevieveBuckley/76ce466e744321514894cf12dcae6c0c to your computer and use it in GitHub Desktop.
Save GenevieveBuckley/76ce466e744321514894cf12dcae6c0c to your computer and use it in GitHub Desktop.
Converting python 2 code to python 3
For the whole repository:
$ 2to3 --output-dir=python3-version/mycode -W -n python2-version/mycode
For a single file:
$ 2to3 filename.py
# See details at:
# https://docs.python.org/2/library/2to3.html
# Stack overflow
# https://stackoverflow.com/questions/20458011/how-to-use-2to3-properly-for-python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment