Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44599

Re: to a human - about 2to3

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: to a human - about 2to3
Date 2013-05-01 18:49 +0100
References <3C8565F3435F024E9BB3B36BE06393D80120F355@albyn-exch.albyn-sch.local.co.uk>
Newsgroups comp.lang.python
Message-ID <mailman.1220.1367430578.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 01/05/2013 15:52, Jennifer Butler wrote:
> Hiya
>
> I have trawled around your various pages and haven’t found what I want.
>
> I will start teaching Python to my pupils shortly. I have been looking
> for materials and have gathered a collection of programs. The problem is
> they are written in v2 and I have v3 installed in my classroom. I read
> about the 2to3 conversion program, but I can’t get it to work.
>
> Could you possibly give me a Noddy’s guide to do this?
>
> Thanks in anticipation.
>
> Jennifer J
>

Here's the help output.  I'd guess (as you don't specify exactly what 
doesn't work, 0/10, must try harder :) that you haven't specified -w, 
--write in which case the files don't get modified.

c:\Users\Mark\MyPython>2to3 --help
Usage: 2to3 [options] file|dir ...

Options:
   -h, --help            show this help message and exit
   -d, --doctests_only   Fix up doctests only
   -f FIX, --fix=FIX     Each FIX specifies a transformation; default: all
   -j PROCESSES, --processes=PROCESSES
                         Run 2to3 concurrently
   -x NOFIX, --nofix=NOFIX
                         Prevent a transformation from being run
   -l, --list-fixes      List available transformations
   -p, --print-function  Modify the grammar so that print() is a function
   -v, --verbose         More verbose logging
   --no-diffs            Don't show diffs of the refactoring
   -w, --write           Write back modified files
   -n, --nobackups       Don't write backups for modified files
   -o OUTPUT_DIR, --output-dir=OUTPUT_DIR
                         Put output files in this directory instead of
                         overwriting the input files.  Requires -n.
   -W, --write-unchanged-files
                         Also write files even if no changes were required
                         (useful with --output-dir); implies -w.
   --add-suffix=ADD_SUFFIX
                         Append this string to all output filenames. 
Requires
                         -n if non-empty.  ex: --add-suffix='3' will 
generate
                         .py3 files.


-- 
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: to a human - about 2to3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-01 18:49 +0100

csiph-web