Re: [Tutor] Arguments from the command line

2010-09-06 Thread aug dawg
Alrighty! Thanks, everyone! On Mon, Sep 6, 2010 at 6:48 PM, Steven D'Aprano wrote: > On Tue, 7 Sep 2010 02:08:27 am Hugo Arts wrote: > > > sys.argv is a list of all arguments from the command line. However, > > you'll rarely deal with it directly, there's various modules that > > deal with hand

Re: [Tutor] Arguments from the command line

2010-09-06 Thread Steven D'Aprano
On Tue, 7 Sep 2010 02:08:27 am Hugo Arts wrote: > sys.argv is a list of all arguments from the command line. However, > you'll rarely deal with it directly, there's various modules that > deal with handling arguments. I believe the current one is argparse: > http://docs.python.org/library/argparse

Re: [Tutor] Arguments from the command line

2010-09-06 Thread bob gailer
On 9/6/2010 11:48 AM, aug dawg wrote: I've seen Python programs that can be activated from the command line. For example: hg This displays a list of commands for the Mercurial revision control system. But another command is this: hg commit "This is a commit name" Mercurial is written in P

Re: [Tutor] Arguments from the command line

2010-09-06 Thread Mark Weil
I think you're looking for this: http://docs.python.org/library/argparse.html you'll also want to read up on sys.argv http://docs.python.org/library/sys.html#sys.argv On Mon, Sep 6, 2010 at 8:48 AM, aug dawg wrote: > I've seen Python programs that can be activated from the command line. For

Re: [Tutor] Arguments from the command line

2010-09-06 Thread Hugo Arts
On Mon, Sep 6, 2010 at 5:48 PM, aug dawg wrote: > I've seen Python programs that can be activated from the command line. For > example: > hg > > This displays a list of commands for the Mercurial revision control system. > But another command is this: > hg commit "This is a commit name" > Mercuria

[Tutor] Arguments from the command line

2010-09-06 Thread aug dawg
I've seen Python programs that can be activated from the command line. For example: hg This displays a list of commands for the Mercurial revision control system. But another command is this: hg commit "This is a commit name" Mercurial is written in Python. I know that commit is a function that

Re: [Tutor] Arguments ina separate file

2008-04-21 Thread linuxian iandsd
> > import myargs this one is clever ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Arguments ina separate file

2008-04-21 Thread Tim Michelsen
> I have a big list of arguments, which I would like to > keep in a separate file. How do I pass arguments that > are in a separate file? do you mean like setting? do something like this write them in the file myargs.py import myargs call_my_function(myargs.argument1, myargs.argument2) see a

[Tutor] Arguments ina separate file

2008-04-21 Thread Sanhita Mallick
Hi. I have a big list of arguments, which I would like to keep in a separate file. How do I pass arguments that are in a separate file? Thanks. San ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] arguments

2007-02-15 Thread Gregor Lingl
[EMAIL PROTECTED] schrieb: >Hi list, > >I have a function with two arguments (say f(x,y)) >and second which returns tuple (say def g(): return (xx,yy)) > >my question is how to put returned values from g() as >arguments to f ? > > There is a special *-operator, which inserts the components of an

Re: [Tutor] arguments

2007-02-15 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > > Hi list, > > I have a function with two arguments (say f(x,y)) > and second which returns tuple (say def g(): return (xx,yy)) > > my question is how to put returned values from g() as > arguments to f ? > > the direct way generates error: > > f(g()) > TypeError: ff

[Tutor] arguments

2007-02-15 Thread emilia12
Hi list, I have a function with two arguments (say f(x,y)) and second which returns tuple (say def g(): return (xx,yy)) my question is how to put returned values from g() as arguments to f ? the direct way generates error: f(g()) TypeError: ff() takes exactly 2 arguments (1 given) and the ha