Why is this not working, no errors? photo exists in correct position... gui doesnt alwyas show up, image doesnt. Using python 3
from tkinter import *
from random import *
import time
mainGUI = Tk()
width2= 319
height2 = 240
widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen
heightOfScreen = mainGUI.winfo_screenheight() #Get the height of the screen
mainGUI.geometry("%dx%d+0+0" % (widthOfScreen+width2, heightOfScreen+height2)) #Set the size of the window to full screen
mainGUI.configure(background = "white")
mainGUI.title("spam Example")
address = r"S:\picture.gif" #Set address of image
print(widthOfScreen, heightOfScreen, address, mainGUI.title)
count = 0
for count in range(0,10):
XValue = randint(0,widthOfScreen-width2)
YValue = randint(0,heightOfScreen-height2)
photo1 = PhotoImage(file=address) #Assign image to PhotoImage
print(widthOfScreen, heightOfScreen, address, mainGUI.title, count, photo1, "\n", XValue, YValue)
imageTopRightCorner = Label(mainGUI,image = photo1, borderwidth = 0).place(x=XValue, y = YValue)
time.sleep(1)
mainGUI.mainloop() #start the event loop