Re: [Tutor] passing variable to python script

2005-10-14 Thread paul brian
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

Re: [Tutor] passing variable to python script

2005-10-13 Thread Alan Gauld
> 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

Re: [Tutor] passing variable to python script

2005-10-13 Thread bob
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

Re: [Tutor] passing variable to python script

2005-10-13 Thread John Fouhy
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', '

Re: [Tutor] passing variable to python script

2005-10-13 Thread Eric Walker
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

[Tutor] passing variable to python script

2005-10-13 Thread Marc Buehler
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