Figured it out for myself in the end. It is simple, I was just missing the ** operator to unpack the dictionary
So my example becomes:
d = dict(p1=1, p2=2)
def f2(p1,p2):
print p1, p2
f2(**d)
More Related Contents:
- “unpacking” a passed dictionary into the function’s name space in Python?
- Function to return results in a dictionary in Python
- Using a dictionary to select function to execute
- How do Python functions handle the types of parameters that you pass in?
- How to pass dictionary items as function arguments in python? [duplicate]
- python function default parameter is evaluated only once? [duplicate]
- Split / Explode a column of dictionaries into separate columns with pandas
- Return a default value if a dictionary key is not available
- Change the name of a key in dictionary
- How to pretty print nested dictionaries?
- Doing something before program exit
- Creating a dictionary from a CSV file
- How do I call a function from another .py file?
- How to dump a dict to a JSON file?
- Overloaded functions in Python
- How can I make a deepcopy of a function in Python?
- Python: Checking if a ‘Dictionary’ is empty doesn’t seem to work
- 5 maximum values in a python dictionary
- Subclassing dict: should dict.__init__() be called?
- Using a Python Dictionary as a Key (Non-nested)
- How to make function decorators and chain them together in Python?
- How do I return dictionary keys as a list in Python?
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- convert csv file to list of dictionaries
- Python dictionary replace values
- Check if all values in list are greater than a certain number
- python dict.add_by_value(dict_2)?
- Mapping dictionary value to list
- How can I combine dictionaries with the same keys?
- How to sort a list of dictionaries by a value of the dictionary in Python?