Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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; 'sys': 0.05; 'formatting': 0.07; 'python': 0.08; '21,': 0.09; '>>>>': 0.09; 'chose': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; 'run.': 0.09; 'window?': 0.09; '~ethan~': 0.09; 'pm,': 0.10; 'this:': 0.10; 'syntax': 0.11; '>>>': 0.12; 'win32': 0.12; 'wrote:': 0.14; '"copyright",': 0.16; '"credits"': 0.16; '"license"': 0.16; 'adam': 0.16; 'booster': 0.16; 'brackets,': 0.16; 'brackets.': 0.16; "computer's": 0.16; 'furman': 0.16; 'indented': 0.16; 'mixture': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'rounds': 0.16; 'looked': 0.16; 'dec': 0.17; 'cc:addr:python-list': 0.17; 'command': 0.19; 'tree': 0.19; 'help.': 0.20; 'header:In-Reply-To:1': 0.21; 'interface': 0.21; 'variable': 0.21; 'seems': 0.21; 'downloaded': 0.21; 'wrote': 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'worked': 0.24; 'invalid': 0.25; 'function': 0.25; 'parameters': 0.26; 'skip:[ 10': 0.26; 'windows': 0.26; 'fixed': 0.27; 'script': 0.27; "i'm": 0.27; '(the': 0.28; 'thanks': 0.28; 'import': 0.29; 'version': 0.29; 'bit': 0.30; 'least': 0.30; 'cc:addr:python.org': 0.30; 'second': 0.30; 'changes': 0.30; 'environment': 0.30; 'looks': 0.31; 'calling': 0.31; 'print': 0.31; '2008,': 0.32; 'does': 0.33; 'actually': 0.33; 'skip:" 20': 0.33; 'error': 0.33; "i've": 0.33; '...': 0.34; "i'll": 0.34; 'file': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; 'skip:" 10': 0.35; 'here,': 0.35; 'using': 0.35; 'skip:o 20': 0.37; 'something': 0.37; 'another': 0.37; 'response': 0.37; 'could': 0.38; 'screen': 0.38; 'but': 0.38; 'data': 0.38; 'earlier': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'should': 0.39; 'level.': 0.39; 'printed': 0.39; 'getting': 0.40; 'really': 0.40; 'generate': 0.60; 'more': 0.60; 'hope': 0.60; 'your': 0.60; 'back': 0.63; 'here': 0.66; 'received:websitewelcome.com': 0.67; 'received:69.93': 0.67; 'chapman': 0.84; 'spec': 0.91; 'url:video': 0.95 Date: Wed, 22 Jun 2011 09:35:30 -0700 From: Ethan Furman User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Adam Chapman Subject: Re: running an existing script References: , <4E00E3DB.9040900@stoneleaf.us> <44f694fd-c075-41a3-a044-c1b05f2a1463@x38g2000pri.googlegroups.com> <2d53da9c-0a28-4f88-b786-f18a3d0f4f11@f2g2000yqh.googlegroups.com> In-Reply-To: <2d53da9c-0a28-4f88-b786-f18a3d0f4f11@f2g2000yqh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:1425 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 81 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308759701 news.xs4all.nl 49177 [::ffff:82.94.164.166]:60636 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8224 Adam Chapman wrote: > On Jun 21, 9:12 pm, Adam Chapman > wrote: >> On Jun 21, 8:00 pm, Ethan Furman wrote: >> >> >> >> >> >> >> >> >> >>> Adam Chapman wrote: >>>> Thanks Ethan >>>> No way could I have worked that out in my state of stress! >>>> For your second idea, would I need to type that into the python command >>>> line interface (the one that looks like a DOS window? >>> If you are actually in a python CLI, at the top of that screen does it >>> say something like >>> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit >>> (Intel)] on win32 >>> Type "help", "copyright", "credits" or "license" for more information. >>> ? >>> If yes, then what I wrote earlier should actually work (I downloaded >>> jBoost and looked at the nfold.py script). Here it is again: >>> --> import os >>> --> os.chdir('path/to/nfold.py') # don't include nfold.py ;) >>> --> import nfold >>> --> import sys >>> --> sys.argv = ["nfold.py", "--folds=5", "--data=spambase.data", >>> ... "--spec=spambase.spec", "--rounds=500", "--tree=ADD_ALL", >>> ... "--generate" ] >>> ... >>> --> nfold.main() >>> I fixed the sys.argv line from last time. >>> Good luck! >>> ~Ethan~ >> Thanks to both of you for your help. >> >> It's getting late here, I'll give it another try tomorrow > > I've added the python directories to the environment variable "path" > in my computer (http://showmedo.com/videotutorials/video? > name=960000&fromSeriesID=96), which means I can now call python from > the windows DOS-style command prompt. > > My formatting must be wrong when calling the nfold.py script to run. > My connad prompt call and the computer's response look like this: > > C:\Users\Adam\Desktop\JBOOST\jboost-2.2\jboost-2.2\scripts>nfold.py > nfold.py > File "C:\Users\Adam\Desktop\JBOOST\jboost-2.2\jboost-2.2\scripts > \nfold.py", line 13 > print 'Usage: nfold.py <--booster=boosttype> <--folds=number> [-- > generate | --dir=dir] [--data=file --spec=file] [--rounds=number -- > tree=treetype]' > > ^ > SyntaxError: invalid syntax Looks like you are using Python 3, but nfold is Python 2. You're being tripped up by one of the non-compatible changes -- namely, print is now a function and so requires (). > What I dont understand is that some of the parameters in the syntax it > printed back are in <> brackets, and others in [] brackets. Looking at nfold.py it seems that rounds and tree are optional, one of generate or dir is required, if dir is not given then data and spec must be, and booster and folds are required -- so I'm not really sure why they chose the mixture of <> and []. Also, on the version of jBoost I downloaded there is at least one error on nfolds.py on line 134 -- it should be indented one more level. Hope this helps. ~Ethan~