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: 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: References: From: Ian Kelly Date: Fri, 30 Jan 2015 09:28:42 -0700 Subject: Re: how to parse sys.argv as dynamic parameters to another function? To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Fri, Jan 30, 2015 at 9:09 AM, Robert Chen 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)