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; 'url:sourceforge': 0.02; 'python.': 0.04; 'python?': 0.05; 'sys': 0.05; 'typing': 0.05; 'python': 0.08; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'matlab': 0.09; 'message- id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'wrote:': 0.14; 'adam': 0.16; 'received:70.85.130': 0.16; 'received:70.85.130.22': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; '"python': 0.16; 'cc:addr:python- list': 0.17; 'perl': 0.19; 'shell': 0.19; 'command': 0.19; 'java,': 0.19; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'trying': 0.23; 'pieces': 0.23; 'code': 0.24; 'function': 0.25; 'url:doc': 0.26; 'skip:[ 10': 0.26; 'script': 0.27; 'example': 0.27; "i'm": 0.27; 'work.': 0.28; 'import': 0.29; "won't": 0.30; 'cc:addr:python.org': 0.30; 'looks': 0.31; 'hi,': 0.31; 'seem': 0.32; "can't": 0.32; 'skip:" 20': 0.33; 'source': 0.34; 'however,': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; 'skip:" 10': 0.35; 'idea': 0.36; 'probably': 0.36; 'skip:o 20': 0.37; 'something': 0.37; 'assuming': 0.37; 'perform': 0.37; 'put': 0.37; 'run': 0.38; 'execute': 0.38; 'subject:: ': 0.38; 'called': 0.39; 'current': 0.40; 'manner': 0.62; 'url:net': 0.63; 'link': 0.64; 'received:websitewelcome.com': 0.67; 'chapman': 0.84 Date: Tue, 21 Jun 2011 11:32:59 -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: In-Reply-To: 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]:3657 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: 45 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308680352 news.xs4all.nl 49178 [::ffff:82.94.164.166]:42297 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8106 Adam Chapman wrote: > Hi, Howdy! > I'm trying to put together a lot of pieces of source code in matlab, > java, perl and python. [snippety] > Basically I just want to run a single script from the python command > window. Once I know how to do that I can be off on my way to perform > the matlab interfacing. > > there is an example of the command I need in the python prompt at > http://jboost.sourceforge.net/doc.html#cv . That looks like a shell prompt, not a Python prompt > however, I can't seem to run the python script by typing the command > on that link in the python prompt. > > Can I please ask how to set the current duirectory in python? nfold.py is a python script -- you can't just type in the name once inside python and have it work. It would require something like --> import os --> os.chdir('path/to/nfold.py') # don't include nfold.py ;) --> import nfold --> import sys --> sys.argv = ["--folds=5", "--data=spambase.data", ... "--spec=spambase.spec", "--rounds=500", "--tree=ADD_ALL", ... "--generate" ] ... --> nfold.main() # assuming it has a main function that can be called # in this manner and that probably won't work. What you probably want to do is execute the command "python /path/to/nfold.py --fold=5 ..." (include the nfold.py this time ). I have no idea how to do that from Matlab. Good luck! ~Ethan~