Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.05; 'concurrently': 0.07; 'modified': 0.07; 'modify': 0.07; 'subject:code': 0.07; 'string': 0.09; '2to3': 0.09; 'append': 0.09; 'ex:': 0.09; 'exit': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'toolkit': 0.09; 'python': 0.11; 'jan': 0.12; 'changes': 0.15; 'default:': 0.16; 'doctests': 0.16; 'filenames.': 0.16; 'implies': 0.16; 'overwriting': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'refactoring': 0.16; 'subject: \n ': 0.16; 'subject:Programming': 0.16; 'subject:python': 0.16; 'files.': 0.16; 'prevent': 0.16; 'language': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'not,': 0.20; 'input': 0.22; 'bruce': 0.22; 'header:User-Agent:1': 0.23; '2.x': 0.24; 'specifies': 0.24; 'subject:Code': 0.24; 'logging': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'interface': 0.32; 'run': 0.32; 'subject:the': 0.34; 'subject: (': 0.35; 'options:': 0.36; 'skip:- 20': 0.37; 'list': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'skip:- 10': 0.38; 'pm,': 0.38; 'does': 0.39; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'most': 0.60; 'conversion': 0.61; 'you.': 0.62; 'back': 0.62; 'show': 0.63; 'more': 0.64; 'subject:. ': 0.67; 'believe': 0.68; 'natural': 0.68; '2.7.': 0.84; 'non-empty.': 0.84; 'received:fios.verizon.net': 0.84; 'processes,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Prob. Code Downloaded for Programming the Semantic Web (python code) Date: Sat, 26 Jul 2014 03:05:37 -0400 References: <8e593a0d-cf61-4b1a-8273-8309496e3696@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <8e593a0d-cf61-4b1a-8273-8309496e3696@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406358361 news.xs4all.nl 2958 [2001:888:2000:d::a6]:56995 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75236 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