I have a class that looks like this:
class imported_feature():
def function_print(self, *recordList):
"""Print the first three argument of the list"""
for i in range(3):
print(recordList[i])
and I want to call the function with something that looks like this:
imported_feature.function_print([columns_to_add[x][j] for x in columns_to_add.keys()])
In columns_to_add I have all the objects that I want to give the function_print(). I iterate the function with "j" (I want to send the "j" element of each key to function_print)
I know how to solve it while making changes in function_print() (change recordList[i] to recordList[0][i]) but I wan't another solution where I change the input to be recognized as multiple objects instead of just one object?
I have tried to do:
list =[columns_to_add[x][j] for x in columns_to_add.keys()]
imported_feature.function_print(str(list)[1:-1])
But that didn't do it, any other tips on how I can unpack the keys in columns_to_add and insert the?