Use the *
argument unpacking operator:
seq = [1, 2, 3]
foo(*seq)
So in the input
function you could use
getattr(self, func)(*args)
PS. Don’t name your variables list
, since it shadows the built-in of the same name.
More Related Contents:
- How to append new line to the list
- How to do relative imports in Python?
- How to query as GROUP BY in django?
- Timeout function if it takes too long to finish [duplicate]
- Python strings and integer concatenation [duplicate]
- How to get a random value from dictionary?
- Reconstruct a categorical variable from dummies in pandas
- Sharing a complex object between processes?
- How to insert newlines on argparse help text?
- What is the difference between pylab and pyplot? [duplicate]
- How to access a function inside a function?
- How to write a generator class?
- Quickest way to make a get_dummies type dataframe from a column with a multiple of strings
- How to read datetime back from sqlite as a datetime instead of string in Python?
- Declare function at end of file in Python [duplicate]
- Flask Download a File
- Fetching datetime from float in Python
- argument 1 has unexpected type ‘Ui_mainWindow’
- How do I attach a remote debugger to a Python process?
- Is there a function to determine which quarter of the year a date is in?
- How can I pass a variable in a decorator to function’s argument in a decorated function?
- Unzip nested zip files in python
- sphinx-build fail – autodoc can’t import/find module
- Python ternary operator [duplicate]
- Edit the values in a list of dictionaries?
- Plotting a line over several graphs
- Extracting lxml xpath for html table
- Extract csv file specific columns to list in Python
- Fit a non-linear function to data/observations with pyMCMC/pyMC
- Same name for classmethod and instancemethod