[Tutor] return a dictionary?

Kent Johnson kent37 at tds.net
Thu Oct 9 21:45:40 CEST 2008


2008/10/9 Bill Gibson <wbgibson2 at yahoo.com>:

> Traceback (most recent call last):
>
>   File "C:\Python24\Lib\SITE-P~1\PYTHON~1\pywin\framework\scriptutils.py",
> line 310, in RunScript
>
>     exec codeObject in __main__.__dict__
>
>   File "C:\Users\B\Desktop\Inter_module.py", line 6, in ?
>
>     y = NameAddress.getName()
>
>   File "C:\Users\B\Desktop\NameAddress.py", line 22, in getName
>
>     theDict={'Name': w2.get(), 'Address1': w4.get(), 'Address2':
> w6.get(),'City':w8.get()}
>
>   File "C:\Python24\Lib\lib-tk\Tkinter.py", line 2303, in get
>
>     return self.tk.call(self._w, 'get')
>
> TclError: invalid command name ".43065216"

This looks like an error in NameAddress.py, perhaps something that is
not being initialized correctly when you import it? Do you have a
if __name__ == '__main__':
section in NameAddress.py? Does it do some required initialization?

It sounds like you are doing something similar to EasyGui's multienterbox:
http://easygui.sourceforge.net/easygui.html#-multenterbox

Kent


More information about the Tutor mailing list