using 2to3

leegeorg07 0 Tallied Votes 178 Views Share

this is code that thanks to vegaseat helped me convert my programs into python30

# run_2to3_convert.py
#
# convert a Python25 code file to a Python30 code file
# generates a backup file and overwrites the original
# file with the converted file
#
# it is best to put this file into a special directory
# together with the Python25 file you want to convert
#
# run this program with Python30

import subprocess

# the Python2x code file you want to convert ...
python2x_scriptfile = "TryExcept1.py"

subprocess.call([r"C:\Python30\Python.exe",
    r"C:\Python30\Tools\Scripts\2to3.py",
    "-w",
    python2x_scriptfile])

print('props to vegaseat for showing me this')
input()