Please Help Convert This Code

David Oppenheimer davidopp at megsinet.net
Wed Sep 22 20:05:58 EDT 1999


Dear Group,

I would really appreciate it if someone could help convert this Tkinter
code into equivalent wxPython code.  Need this to be done to create a
drag and drop GUI maker that will have Tkinter AND wxPython as output
choices.  Thanks in advance.

David O.


from Tkinter import *

def write_defaults(Widget):
        widget = Widget()
        widget.place(x=0, y=0)
        filename = "%s.txt" % Widget.__name__
        file = open(filename, "w")
        for key in widget.keys():
                if widget[key] == "":
                        widget[key] = None
                        print widget[key]
                file.write("%s = %s\n" % (key, widget[key]) )
        file.close()



if __name__ == "__main__":
        root = Tk()
        widgets = [ Button,
                        Canvas,
                        Checkbutton,
                        Entry,
                        Frame,
                        Label,
                        Listbox,
                        #Menu,
                        Menubutton,
                        Message,
                        Radiobutton,
                        Scale,
                        Scrollbar]
        for widget in widgets:
                write_defaults(widget)
        root.mainloop()









More information about the Python-list mailing list