First time here? Check out the FAQ!

Revision history  [back]

wingIDE not working with python3+tkinter ???

I started the long & painful transition of my tkinter program to python3... I discovered that I have to change the name of a lot of tkinter modules (see https://stackoverflow.com/questions/673174/which-tkinter-modules-were-renamed-in-python-3), but I'm stumped at this, that could be related to WingIDE:

Launching this code portion by itself works:

#!/usr/bin/python3

from tkinter import *
from tkinter import simpledialog

class PasswordDialog(simpledialog.Dialog):
    def body(self, master):
        Label(master, text="Password for file ").grid(row=0, sticky=W)
        self.e1 = Entry(master,show='*')
        self.e1.grid(row=0, column=1)
        self.attributes("-topmost", True)
        return self.e1
    def apply(self):
        p = self.e1.get()
        self.result = p


def main():
        root = Tk()
        pwd = PasswordDialog(root,title='Enter password').result
        print(pwd)
        mainloop()

main()

while if I write it from WingIDE and run it there by pressing F5, I get:

File "/usr/src/untitled-1.py", line 6, in <module>
  class PasswordDialog(simpledialog.Dialog):

AttributeError: 'module' object has no attribute 'Dialog'

can anybody see what's wrong???