I have a program that has an update_database()
function but I don't know what the keyword arguments will be until runtime, so one time the function is called it may need to be:
table_name = 'example1'
update_database(table_name, column1='...', column3='...')
but another time it may be:
table_name = 'example2'
update_database(table_name, column5='...', column2='...')
So the function calls will need to be a mix of regular arguments and keyword arguments. The keyword argument names I have access to as a list so I can format them any old way I like easy enough but I m not sure if this behaviour is even possible in python.
Does anybody know if/how this may be possible?
UPDATE:
Its also worth noting that the update_database()
function is part of an imported module so i cant modify its definition, I could wrap it somehow but I'm not sure if this gains me anything.