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?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'parameters': 0.04; 'perl,': 0.07; 'parameter': 0.09; 'jan': 0.12; 'function?': 0.16; 'subject:parameters': 0.16; 'wrote:': 0.18; 'help.': 0.21; 'separate': 0.22; 'parse': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'robert': 0.30; 'message-id:@mail.gmail.com': 0.30; 'another': 0.32; 'fri,': 0.33; 'received:google.com': 0.35; 'subject:?': 0.36; 'so,': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; '30,': 0.65; '2015': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CEdHUTSZohGR7QfZ1naFCEnInduClCJOwMbD29jvNHk=; b=qkwJ9oATFtqZKu6YgGHSaGDEsLo2YK0N2xvE2ZhV/BsOQ5MUv+yMyq/cRYfaO5Mchg JCBxgsC9pjg+VT2kjaV+7uQdxXrCWQRH0LW97wsGLw1QouRVE5h6laULkOePUN9UMNoq pxEfqjIrPmYHS6v4/tQV0jreuAEaHC/buwPNxFJR+pT4UtvNH6z34hBmgZW1nIUjEApa E5IMwbteLR5+6483ywqE9zh7zrWr0j+/gHpsx/CDZANi9AGIxdCAG9a7mn/qm5ldGdaX 5jCJ2zz03smcFmJrq3oWr2ViDgQGtKqBP8AUNhptf/qe+8FN9UephchSFDZ2NeYS2fbh XwYw==
X-Received by 10.70.21.132 with SMTP id v4mr10065610pde.114.1422635362950; Fri, 30 Jan 2015 08:29:22 -0800 (PST)
MIME-Version 1.0
In-Reply-To <baa4011f-0745-4f8b-a6f5-fc242a886d78@googlegroups.com>
References <baa4011f-0745-4f8b-a6f5-fc242a886d78@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Fri, 30 Jan 2015 09:28:42 -0700
Subject Re: how to parse sys.argv as dynamic parameters to another function?
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18311.1422635372.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422635372 news.xs4all.nl 2844 [2001:888:2000:d::a6]:56290
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84900

Show key headers only | 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