Here is an example of how you could use Tkinter, a loop, counter, and some other stuff. Here is the program code:
#Created by Mattamus Prime (AKA Matt Tacular)
#This is a simple dice program, pretends to roll a die and show you the progress
#After 25 random screens, it picks one to show.
import random
from Tkinter import *
import time
def clear():
answerLabel2.configure(text="")
answerLabel3.configure(text="")
answerLabel4.configure(text="")
mainWindow.update()
def aDie():
infiniteLoop = True
counter = 0
while infiniteLoop:
number = random.randint(1,6)
time.sleep(0.1)
clear()
counter += 1
if number == 1:
strDie2 = "I I"
strDie3 = "I II I"
strDie4 = "I I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
elif number == 2:
strDie2 = "I II I"
strDie3 = "I I"
strDie4 = "I II I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
elif number == 3:
strDie2 = "I II I"
strDie3 = "I II I"
strDie4 = "I II I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
elif number == 4:
strDie2 = "I II II I"
strDie3 = "I I"
strDie4 = "I II II I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
elif number == 5:
strDie2 = "I II II I"
strDie3 = "I II I"
strDie4 = "I II II I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
elif number == 6:
strDie2 = "I II II I"
strDie3 = "I II II I"
strDie4 = "I II II I"
answerLabel2.configure(text=strDie2)
answerLabel3.configure(text=strDie3)
answerLabel4.configure(text=strDie4)
number = random.randint(1,6)
if counter == 25:
break
mainWindow.update()
mainWindow = Tk()
startButton = Button(mainWindow, text="Roll", command=aDie, width=20)
startButton.grid(row=0, column=0)
answerLabel = Label(mainWindow, text="IIIIIIIIIIIIIIII", width=20)
answerLabel.grid(row=1, column=0)
answerLabel2 = Label(mainWindow, text="I I", width=20)
answerLabel2.grid(row=2, column=0)
answerLabel3 = Label(mainWindow, text="I I", width=20)
answerLabel3.grid(row=3, column=0)
answerLabel4 = Label(mainWindow, text="I I", width=20)
answerLabel4.grid(row=4, column=0)
answerLabel5 = Label(mainWindow, text="IIIIIIIIIIIIIIII", width=20)
answerLabel5.grid(row=5, column=0)
mainWindow.mainloop()
What I did, was made a window in Tkinter and in that window made a "Roll" Button. then there are 5 blank labels that get filled by different lines of IIII's depending on what number from 1 - 6 is chosen.
This also shows how you can set up a loop that only ends when the counter hits a certain number, and that only happens when the die has displayed a certain amount of numbers.
And if you want it to run the window with no console, save the code as "filename.pyw" instead of "filename.py"