using 2to3

leegeorg07 leegeorg07 is offline Offline Apr 17th, 2009, 4:07 am |
0
this is code that thanks to vegaseat helped me convert my programs into python30
Quick reply to this message  
Python Syntax
  1. # run_2to3_convert.py
  2. #
  3. # convert a Python25 code file to a Python30 code file
  4. # generates a backup file and overwrites the original
  5. # file with the converted file
  6. #
  7. # it is best to put this file into a special directory
  8. # together with the Python25 file you want to convert
  9. #
  10. # run this program with Python30
  11.  
  12. import subprocess
  13.  
  14. # the Python2x code file you want to convert ...
  15. python2x_scriptfile = "TryExcept1.py"
  16.  
  17. subprocess.call([r"C:\Python30\Python.exe",
  18. r"C:\Python30\Tools\Scripts\2to3.py",
  19. "-w",
  20. python2x_scriptfile])
  21.  
  22. print('props to vegaseat for showing me this')
  23. input()

Message:


Similar Threads
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC