-1

Now I want to design a simple game by using python, the step I want to do is to add an icon on the left of the window. However, when I type

game_window.iconbitmap('favicon.ico')

game_window.mainloop()

the system just tell me Document Drag Error.

Image of error

I am sure I save favicon and the both in the desktop and both of the path is correct.

I search this question in the internet but all of them are using window os.

Henry
  • 3,472
  • 2
  • 12
  • 36

1 Answers1

0

If your icon is in the same folder as your file, the script will surely work...

I think that you're getting the error because you didn't save the file you're working on for the first time. Try the following:

Save your file in the same folder another time (if you've already done it). If it doesn't work, then write the full path of the icon

Adam Lozi
  • 60
  • 6
  • well, I try also try to save them in the folder, but it still show the same error. Besides, I do not know how to write the full path of the icon. Is it like this? ‘/Users/noahsark/Desktop/~/Desktop/favicon.ico’ – Noah Cheng Sep 20 '21 at 03:39