First time here? Check out the FAQ!
0

wingIDE not working with python3+tkinter ???

  • retag add tags

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???

alexxx's avatar
16
alexxx
asked 2019-09-16 07:00:48 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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...

alexxx's avatar
16
alexxx
answered 2019-09-16 07:06:41 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer