Apr-03-2018, 11:14 AM
(This post was last modified: Apr-03-2018, 11:15 AM by admiralsulko.)
I came on a little solution but Im getting this error
Output:>>> Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Dominik\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1702, in __call__
return self.func(*args)
File "C:\Users\Dominik\Desktop\INF - Výťah\Výťah.py", line 103, in prikaz1
zobrazenie()
File "C:\Users\Dominik\Desktop\INF - Výťah\Výťah.py", line 34, in zobrazenie
canvas.pack(img2)
File "C:\Users\Dominik\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 2140, in pack_configure
+ self._options(cnf, kw))
File "C:\Users\Dominik\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1317, in _options
cnf = _cnfmerge(cnf)
File "C:\Users\Dominik\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 101, in _cnfmerge
for c in _flatten(cnfs):
TypeError: object of type 'int' has no len()
=========== RESTART: C:\Users\Dominik\Desktop\INF - Výťah\Výťah.py ===========
Solution looks like this:def zmazanie(): canvas.delete(img1) def zobrazenie(): global y_vytah if y_vytah > 330: picture2 = tkinter.PhotoImage(file = "C:/Users/Dominik/Desktop/INF - Výťah/tabulka1poschodie.png") img2 = canvas.create_image(720, 300, image = picture2) canvas.pack(img2) def prikaz1(): posun_1() zmazanie() zobrazenie()But I cant get on thing like if it will come to position I want it will display the image...