root.iconbitmap("C:\User\user\Desktop\Pycharm\dragon.ico")
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 8-9: truncated \uXXXX escape
root.iconbitmap("C:\User\user\Desktop\Pycharm\dragon.ico")
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 8-9: truncated \uXXXX escape
Answer:
The problem is with the string "C:\User\user\Desktop\Pycharm\dragon.ico"
In the string, \U in C:\Users starts an eight-character Unicode escape. In your code, the escape is followed by the character 's', which is invalid.
There are two solutions:
"C:\\User\\user\\Desktop\\Pycharm\\dragon.ico"r to the string, to transform it into a raw string:r"C:\User\user\Desktop\Pycharm\dragon.ico"Additional Links / References:
"Unicode Error "unicodeescape" codec can't decode bytes... Cannot open text files in Python 3