Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread shawn bright
Just what i was looking for, thanks
shawn

On 9/14/07, Alan Gauld <[EMAIL PROTECTED]> wrote:
>
>
> "shawn bright" <[EMAIL PROTECTED]> wrote
>
> > i am sure i do it with sys args, but don't know how.
> >
> > like
> >
> > python run_my_script.py somevar
> >
> > does this make sense ?
> >
>
> Check my Talking to the User topic in my tutorial.
> The second half talks about using command line arguments.
>
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.freenetpages.co.uk/hp/alan.gauld
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread Alan Gauld

"shawn bright" <[EMAIL PROTECTED]> wrote 

> i am sure i do it with sys args, but don't know how.
> 
> like
> 
> python run_my_script.py somevar
> 
> does this make sense ?
> 

Check my Talking to the User topic in my tutorial.
The second half talks about using command line arguments.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread Tom Tucker
See optparse  or
sys.argv.



On 9/14/07, shawn bright <[EMAIL PROTECTED]> wrote:
>
> lo there all,
>
> i want to write a program that will be called from another program.
> I need to pass it one variable.
> i suppose i could also do this with a module, and create a new instance of
> whatever i want to pass it to,
> but all the same, how would i go about this. like if i had a program that
> i wanted to pass a number into.
>
> i am sure i do it with sys args, but don't know how.
>
> like
>
> python run_my_script.py somevar
>
> does this make sense ?
>
> The other way to do this is create a class i suppose that could be called.
> Should probably do it that way, but still, i would like to know.
>
> thanks.
>
> shawn
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] how to add arguments to a command line program

2007-09-14 Thread shawn bright
lo there all,

i want to write a program that will be called from another program.
I need to pass it one variable.
i suppose i could also do this with a module, and create a new instance of
whatever i want to pass it to,
but all the same, how would i go about this. like if i had a program that i
wanted to pass a number into.

i am sure i do it with sys args, but don't know how.

like

python run_my_script.py somevar

does this make sense ?

The other way to do this is create a class i suppose that could be called.
Should probably do it that way, but still, i would like to know.

thanks.

shawn
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor