Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. from tkinter import Tk
  2. root = Tk()
  3. #some other codes here which you don't really need to care about
  4.  
  5. root.iconbitmap(r'icon.ico') #<--- this statement will be adding the icon
  6. root.mainloop()
  7.  
  8.  
  9.  
  10. --------------------------------error----
  11. Traceback (most recent call last):
  12. File "file.py", line 12, in <module>
  13. root.iconbitmap(r'icon.ico')
  14. File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1701, in wm_iconbitmap
  15. return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
  16. _tkinter.TclError: bitmap "icon.ico" not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement