So lets say i have a python function like this:
def function_name(*param1, param2):
...
And i have a string "120,220,400". Is there a way i can place it in param1 without transforming it to a tuple of lists/other tuples? i tried using .split(',') but i just end up having ["120","220","400"].
I still want to use *param1 and dont really want to change the function, i am just developing a ui where the value read in the label comes out with a string "120,220,400"
If you have a variable
my_var = "120,220,400", you can call your function like so:The
*unpacks the list returned bystr.splitinto different parameters, which then get packed back up into a single tuple.