How do I pass in a parameter name into a function as an argument?
def edit_features_retry(editType,data):
AGOLlayer.edit_features(editType=data)
edit_features_retry("adds", datalayer)
error:
TypeError: edit_features() got an unexpected keyword argument 'editType'
If I do it this way as a string:
def edit_features_retry(editType,data):
AGOLlayer.edit_features(editType=data)
edit_features_retry(adds, datalayer)
error:
NameError: name 'adds' is not defined
You can use dictionary unpacking.
Here's a simple example:
Which can be applied to your scenario: