multiple values for keyword argument
Francesco Bochicchio
bieffe62 at gmail.com
Sat Jan 29 06:24:06 EST 2011
On 29 Gen, 12:10, Tobias Blass <tobiasbl... at gmx.net> wrote:
> Hi all
> I'm just learning python and use it to write a GUI (with Tkinter) for a C
> program I already wrote. When trying to execute the program below I get the
> following error message.
>
> Traceback (most recent call last):
> File "./abirechner.py", line 64, in <module>
> win =MainWin()
> File "./abirechner.py", line 43, in __init__
> self.create_edit(row=i);
> TypeError: create_edit() got multiple values for keyword argument 'row'
>
> I don't really understand why create_edit gets multiple values, it gets one
> Integer after another (as I see it)
> Thanks for your help
>
> abirechner.py:
>
> # line 37
> class MainWin(Frame):
> def __init__(self,master=None):
> Frame.__init__(self,master)
> self.grid()
> self.edits=()
> for i in range(10):
> self.create_edit(row=i);
> def create_edit(row,self):
> # LineEdit is defined, but I don't consider it important here
> self.edits+=LineEdit()
> self.edits[-1].grid(row=row,column=0)
> # ...
> #line 64
> win = MainWin()
> win.mainLoop()
Try this:
> def create_edit(self, row):
Ciao
---
FB
More information about the Python-list
mailing list