I have the following code:
from gettext import find
import urllib.request
import re
s = "here it must be a google forms URL"
formsHTML = "x"
response = "x"
quot = "",null,0,[["
def openURL ():
print (response)
print (quot)
print (formsHTML)
with urllib.request.urlopen(s) as f:
formsHTML = f.read().decode('utf-8')
Somehow, when I try to access formsHTML it gives me back "UnboundLocalError: local variable 'formsHTML' referenced before assignment", but it does not happen the same with the other variables. I'm probably wrong, but shoudn't they be all defined on the global scope?