Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What did I do wrongly?
#1
Sad 
It says icon.ico not defined, what should I do? The icon.ico is in the same folder as the script im trying to run.

from tkinter import *
from PIL import ImageTk, Image

root = Tk()

root.title('Images')

root.iconbitmap('icon.ico')

my_img = ImageTk.PhotoImage(Image.open("Pasi.png"))
my_label = Label(image=my_img)
my_label.pack()

button_quit = Button(root, text="Exit", command=root.quit)
button_quit.pack()

root.mainloop()
Gribouillis write Aug-07-2022, 08:11 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
What did I do wrongly? - by Tomi - Aug-07-2022, 07:25 AM
RE: What did I do wrongly? - by Gribouillis - Aug-07-2022, 08:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python reading variable in another py file wrongly _vertig0 2 2,852 Nov-21-2020, 07:19 AM
Last Post: _vertig0

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020