Re: passing file from command line startup

2010-08-11 Thread MRAB
Bradley Hintze wrote: Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the full path to mytext.t

Re: passing file from command line startup

2010-08-11 Thread Robert Kern
On 8/11/10 1:47 PM, Bradley Hintze wrote: Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the

Re: passing file from command line startup

2010-08-11 Thread Peter Otten
Bradley Hintze wrote: > Hi all, > > Is there a way that I can startup my script and pass it a file? For > example: > > ~$ python myscript.py mytext.txt > > and then access mytext.txt in myscript.py? > > As a long shot, for myscript.py I tried > > def __init__(fle): > print fle > > expect

passing file from command line startup

2010-08-11 Thread Bradley Hintze
Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the full path to mytext.txt to be printed but tha