Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84900

Re: how to parse sys.argv as dynamic parameters to another function?

References <baa4011f-0745-4f8b-a6f5-fc242a886d78@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2015-01-30 09:28 -0700
Subject Re: how to parse sys.argv as dynamic parameters to another function?
Newsgroups comp.lang.python
Message-ID <mailman.18311.1422635372.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jan 30, 2015 at 9:09 AM, Robert Chen <robertchen117@gmail.com> wrote:
> how to parse sys.argv as dynamic parameters to another function?
>
>
> fun(sys.argv)
>
> in perl, this is very easy. please help.

Do you mean that you want each item of sys.argv to be passed as a
separate parameter to the function? If so, then:

fun(*sys.argv)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to parse sys.argv as dynamic parameters to another function? Robert Chen <robertchen117@gmail.com> - 2015-01-30 08:09 -0800
  Re: how to parse sys.argv as dynamic parameters to another function? Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-30 10:16 -0600
  Re: how to parse sys.argv as dynamic parameters to another function? Ian Kelly <ian.g.kelly@gmail.com> - 2015-01-30 09:28 -0700
  Re: how to parse sys.argv as dynamic parameters to another function? Ned Batchelder <ned@nedbatchelder.com> - 2015-01-30 14:05 -0500

csiph-web