Python Forum
[Tkinter] Python - help with making a lift
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Python - help with making a lift
#2
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...
Reply


Messages In This Thread
Python - help with making a lift - by admiralsulko - Apr-03-2018, 09:24 AM
RE: Python - help with making a lift - by admiralsulko - Apr-03-2018, 11:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a Python programming environment like VB6 [meta-GUI: GUI making GUI] JonathanEngr 21 17,654 Nov-30-2017, 10:31 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020