|
Convert Python 2.x series to Python 3.x series
|
|
08-07-2010, 11:31 PM
Post: #1
|
|||
|
|||
|
Convert Python 2.x series to Python 3.x series
Python 3 comes with a program called 2to3. This program allows you to convert your Python 2.x scripts to 3.x scripts. I convert all my scripts to 3.1 so I can run with on either 2.x or 3.x series. Examples of using 2to3 on mac or Linux.
Code: 2to3 myscript.py //This will print all the that 2to3 will change in a script without physically chaning itThere are other commands you can do using 2to3 just type 2to3 --help to see a list of commands. |
|||
|
09-27-2010, 12:26 AM
Post: #2
|
|||
|
|||
|
RE: Convert Python 2.x series to Python 3.x series
What are the major differences? I know that the print statement now requires parentheses and raw_input has been replaced by just input.
"Character is determined more by the lack of certain experiences than by those one has had." Friedrich Nietzsche |
|||
|
07-11-2011, 06:22 PM
Post: #3
|
|||
|
|||
|
RE: Convert Python 2.x series to Python 3.x series
Yea, must be closed in () and some minor function change in math classes etc... Instead of returning a integer it may return a float. Not to many major changes though.
|
|||
|
« Next Oldest | Next Newest »
|





