I tried to run dis code (its a little game and now im adding the graphics but it gives me the 'UnboundLocalError:' and i dont realy know what im doing wrong
from graphics import *
import time
import random
a = 5
c = 0
ix = 1001
x = 2
def main():
while int(ix) != int(a):
win = GraphWin('Game', 500, 500)
shape = Rectangle(Point(499,499), Point(0,0))
shape.setOutline("red")
shape.draw(win)
shape = Rectangle(Point(200, 100), Point(300, 0))
shape.setOutline("black")
shape.draw(win)
input = Entry(Point(250, 450), 10)
input.draw(win)
win.getMouse()
ix = input.getText()
testText = Text(Point(250, 50), ix)
testText.draw(win)
time.sleep(1)
testText.setText('')
main()
As result i expect a loop in the graphic window where when the input ix = a the loop ends.