2to3 Help?

John Machin sjmachin at lexicon.net
Thu Mar 5 03:43:48 EST 2009


On Mar 5, 6:47 pm, jjh <jhirono2... at yahoo.com> wrote:
> On Jan 14, 10:01 pm, marco.m.peter... at gmail.com wrote:
[snipped]

> Sorry to bring this back up.

The correct thing to do is to start a NEW post. Marco's problem is
nothing to do with yours.




> I'm a newbie trying to run 2to3 on
> Windows. I ran the following:
>
> C:\Python30\python.exe C:\Python30\Tools\Scripts\2to3.py c:\python\src\testscript.py

The .exe should not be necessary ... if you have put a python.bat or a
python.com or similar in that directory, lose them soon.

>
> and I got the following:
>
> C:\Users\user>C:\Python30\python.exe C:\Python30\Tools\Scripts\2to3.py
> c:\python\src\testscript.py
> RefactoringTool: Skipping implicit fixer: buffer
> RefactoringTool: Skipping implicit fixer: idioms
> RefactoringTool: Skipping implicit fixer: set_literal
> RefactoringTool: Skipping implicit fixer: ws_comma
> --- c:\python\src\testscript.py (original)
> +++ c:\python\src\testscript.py (refactored)
> @@ -1,3 +1,3 @@
>  #! /usr/bin/python
>
> -print "Hello World";
> +print("Hello World");
> RefactoringTool: Files that need to be modified:
> RefactoringTool: c:\python\src\testscript.py
>
> what am I suppose to do after that? I thought it would re-write my
> testscript.py but it didn't. Thanks so much for the help.

What made you think so? Thinking is a very good idea, but when you are
a new user of a piece of software it's an even better idea to read the
manual (http://docs.python.org/3.0/library/2to3.html) and check that
it follows the usual command-line help convention (c:\python30\python
c:\python30\tools\scripts\2to3.py --help) and that the fancy Windows
help for Python is working ((Windows XP) click on Start>All
Programs>Python 3.0>Python Manuals, type 2to3 then Enter) just in case
you are ever disconnected from the Internet and/or want faster
response.

HTH,
John



More information about the Python-list mailing list