There are several approaches ranging from the simple but limited to
rather advanced.
raw_input is the simplest but it is to be deprecated, and more
importantly it limits you to entering commands after the script is
running. automation becomes harder
$ myscript
Those args are put into a list ca
> i want to pass an argument (a number) to a python
> script when running it:
>> python script.py
>
> i want to be able to use within script.py
> as a parameter.
>
> how do i set this up?
This is covered in the 'talking to the user' topic in my tutorial.
The short answer is use sys.argv
Alan
At 04:09 PM 10/13/2005, Marc Buehler wrote:
>hi.
>
>i want to pass an argument (a number) to a python
>script when running it:
> > python script.py
>
>i want to be able to use within script.py
>as a parameter.
>
>how do i set this up?
In the sys module there is a property argv. The docs say: "Th
On 14/10/05, Marc Buehler <[EMAIL PROTECTED]> wrote:
> hi.
>
> i want to pass an argument (a number) to a python
> script when running it:
> > python script.py
Have a look at sys.argv!
testargs.py
import sys
print sys.argv
C:\temp>python testargv.py 1 2 foo
['testargv.py', '1', '
z = raw_input("Please Enter? :\n")
On Thursday 13 October 2005 05:09 pm, Marc Buehler wrote:
> hi.
>
> i want to pass an argument (a number) to a python
>
> script when running it:
> > python script.py
>
> i want to be able to use within script.py
> as a parameter.
>
> how do i set this up?
>
> m
hi.
i want to pass an argument (a number) to a python
script when running it:
> python script.py
i want to be able to use within script.py
as a parameter.
how do i set this up?
marc
---
The apocalyptic visio