-1
Good night!
I’m having a small problem with python 3.x on my linux Mint 19.03
Code:
#!/usr/bin/env python3
#-*-coding: utf-8-*-
from tkinter import *
win = Tk()
def msg():
m = val.get()
Label(win, text=m).pack()
win.geometry("250x250+250+250")
win.title("aula excript")
val = Entry(win).pack()
Button(win, text="ok", command=msg).pack()
win.mainloop()
The above code is generating the following exception:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "./tt.py", line 6, in msg
m = val.get()
AttributeError: 'NoneType' object has no attribute 'get'
Thanks in advance =D