I wish to create a loop which adds images across a screen with random positions:

photo1 = PhotoImage(file=address) #Assign image to PhotoImage
    XValue = randint(0,widthOfScreen-width2) #width2 = image width
    YValue = randint(0,heightOfScreen-height2) #width2 = image height
    Label(mainGUI, background = "white", image = photo1, borderwidth = 0).place(x=XValue, y = YValue)

the code works and places the objects randomly but if i try and add a


into the loop then the gui isnt made until the ned of the program with all images finished....

I'm not sure if they can function well together

Don't use sleep() in gui programs. Use a timer instead (method after() in tkinter). Run this example by PyTony to see how it works.

Actually you can use time.sleep() with Tkinter but you have to use update() too ...

''' tk_image_slideshow_sleep.py
create a very simple Tkinter image slide show
using time.sleep() and root.update()
tested with Python27/33  by  vegaseat  03dec2013

import time
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

# get a series of gif images you have in the working folder
# or use full path name
image_files = [

root = tk.Tk()
label = tk.Label(root)

delay = 3.2  # seconds delay between slides
for image in image_files:
    image_object = tk.PhotoImage(file=image)

commented: Very helpful +1