Ich versuche gerade Tkinter zu lernen und möchte nun Photos anzeigen. In dem Tutorial das ich mache( http://www.python-kurs.eu/tkinter_labels.php ) wird dafür PhotoImage verwendet. Wenn ich aber den exakt selben code schreibe, wie im Tutorial ( nur den Pfad und bildnamen entsprechend geändert), dann bekomme ich eine Fehlermeldung:
"Syntax Error (unicode Error)'unicodeescape' codec can't decode bytes in position 2-3: truncated\UXXXXXXXX escape"
Hier der Code:
from tkinter import *
root = Tk()
logo = PhotoImage(file="F:\Users\Louis\Desktop\Python.gif")
w1 = Label(root, image=logo).pack(side="right")
explanation = """At present, only GIF and PPM/PGM
formats are supported, but an interface
exists to allow additional image file
formats to be added easily."""
w2 = Label(root,
justify=LEFT,
padx = 10,
text=explanation).pack(side="left")
root.mainloop()