On 1/30/15 11:28 AM, Ian Kelly wrote:
On Fri, Jan 30, 2015 at 9:09 AM, Robert Chen <robertchen...@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)


Robert, this will work, but keep in mind that sys.argv is a list of strings, always. If your function is expecting integers, you will have to do an explicit conversion somewhere.

--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to