Hello. I'm getting data from an external source and would like to build up a menu using that, with an unknown number of items, each which should ideally call the same function with different parameters.
I can specify the same function as callback for all items, but it doesn't seem to me that any item index number etc. is passed as argument to the callback function.
I've tried to specify my own arguments, but as you can see below, without succes:
This is what happens when I choose item2, when defining argument as extra parameter. The extra parameter is ignored...
And if I specify the function call with the parameter:
>>> def a(nr):
... print nr
>>> TypeError: a() takes exactly 1 argument (0 given)
What should I do?
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: list of (unicode, callable) or (unicode, (unicode, callable)...) expected