I try to load a window logo to my GUI, and I get a syntax error for some reason.
This is my code:
from tkinter import *
from PIL import ImageTK, Image
root = Tk()
root.title("Medical Aid")
root.iconbitmap('C:\Users\97253\Desktop\logo.ico')
helloLable = Label(root, text="WELCOME").grid(row=0, column=0)
label1= Label(root, text="user name:").grid(row=2, column=0)
field1 = Text(root, height=2, width=30).grid(row=3 , column=0)
label2= Label(root, text="password:").grid(row=4, column=0)
field2 = Text(root, height=2, width=30).grid(row=5, column=0)
root.mainloop()
This is the error I get:
$ python loginScreen.py
File "C:\Users\97253\Desktop\loginScreen.py", line 7
photo = PhotoImage(file = 'C:\Users\97253\Desktop\logo.jpg')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I saw that there are a lot of ways to do that, and I tried different ways and each time is the same error.