Ask Your Question
0

wingIDE not working with python3+tkinter ???

asked 2019-09-16 07:00:48 -0600

alexxx gravatar image

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/6...), 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???

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-16 07:06:41 -0600

alexxx gravatar image

please, disregard my post:

I just discovered that if I want to switch my projact to python3 it isnt sufficient to alter the shebang line, I also have to modify the predefined binary under Source>show python environment

sorry...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-09-16 07:00:48 -0600

Seen: 48 times

Last updated: Sep 16