I receive :
UnboundLocalError: local variable 'ImgY' referenced before assignment
When I do something like this:
q = 0
def a():
  print(q)
while True:
  com = input("")
  if com == "":
    a()
  else:
    q = com
The piece "a()":
def df():
  global deas
  if vs != 1:
    if deas == 0:
      deas = 1
      for a in range(ImgY):
        for s in range(ImgX):
          corrente[num[a] + num[s]] = " "
  else:
    if imp == 1:
      ImgX = q[0:1]
      ImgY = q[2:3]
      for a in range(int(ImgY)):
          for s in range(int(ImgX)):
            corrente[num[a] + num[s]] = q[s+5]
    else:
      if deas == 0:
        deas = 1
        for a in range(ImgY):
          for s in range(ImgX):
            corrente[num[a] + num[s]] = " "
I don't understand why since ImgY is a global variable and is defined with "ImgY = 30" on the line below (the global) The rest here
 
    