http://stackoverflow.com/questions/7745952/python-expand-list-to-function-arguments
Note: A list is not expanded as arguments by itself.
def a(b,c):
print(b)
d = [2,3]
a(d) : Will not work because the given list is not expanded.
a(*d) will work: see https://docs.python.org/2/tutorial/controlflow.html#unpacking-argument-lists
No comments:
Post a Comment