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


Groups > comp.lang.python > #75236

Re: Prob. Code Downloaded for Programming the Semantic Web (python code)

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Prob. Code Downloaded for Programming the Semantic Web (python code)
Date 2014-07-26 03:05 -0400
References <8e593a0d-cf61-4b1a-8273-8309496e3696@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.12340.1406358361.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 7/25/2014 8:06 PM, Bruce Whealton wrote:

The book has python 2.x code. If the modules in the book use the Natural 
Language Toolkit (nltk), then I believe you are currently stuck with 
using 2.7.

If it does not, and you want to run with 3.3 or 3.4, then use 2to3 to do 
most to all of the conversion for you.

C:\Programs\Python34>python Tools/scripts/2to3.py -h
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.

This is the user interface for lib2to3.

-- 
Terry Jan Reedy

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


Thread

Prob. Code Downloaded for Programming the Semantic Web (python code) Bruce Whealton <futurewavewebdevelopment@gmail.com> - 2014-07-25 17:06 -0700
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Skip Montanaro <skip@pobox.com> - 2014-07-25 19:21 -0500
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Dan Stromberg <drsalists@gmail.com> - 2014-07-25 17:52 -0700
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-25 19:39 -0600
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Steven D'Aprano <steve+gmane@pearwood.info> - 2014-07-26 11:28 +1000
    Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Bruce Whealton <futurewavewebdevelopment@gmail.com> - 2014-07-28 03:39 -0700
      Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-28 15:28 +0000
        Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Bruce Whealton <futurewavewebdevelopment@gmail.com> - 2014-07-28 17:57 -0700
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Chris Angelico <rosuav@gmail.com> - 2014-07-26 13:25 +1000
    Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Bruce Whealton <futurewavewebdevelopment@gmail.com> - 2014-07-28 04:07 -0700
  Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Terry Reedy <tjreedy@udel.edu> - 2014-07-26 03:05 -0400

csiph-web