As part of my log in GUI, once the correct details are entered, the user goes through to the homescreen page.
def login():
content = nameentry.get()
content1 = IDentry.get()
if content == "1" and content1 == "1":
root.destroy(), execfile("Homescreenscroll - Copy3.1.py")
However, when the Homescreenscroll - Copy3.1.py is opened and runs, it says
Exception in thread Thread-1: Traceback (most recent call last):
File "C:\Users\Isaac\Desktop\Py\lib\threading.py", line 530, in __bootstrap_inner
self.run()
File "C:\Users\Isaac\Desktop\Py\lib\threading.py", line 483, in run
self.__target(*self.__args, **self.__kwargs)
File "Homescreenscroll - Copy3.1.py", line 5862, in trick
WTI['text'] = row[0]
NameError: global name 'WTI' is not defined
Even though it is clearly defined in the 'Homescreenscroll - Copy3.1.py' file
It is part of this thread in the 'Homescreenscroll - Copy3.1.py' file:
WTI = Label(text = "")
def trick(threadName, sleepTime):
while 1 < 2:
db=MySQLdb.connect(host = "xxx",
user = "xxx",
passwd = "xxx",
db = "test")
cursor = db.cursor()
cursor.execute("""xxxx""", (xxxxx))
cursor.execute("""xxxx""", (xxxx))
db.commit()
row=cursor.fetchone()
WTI['text'] = row[0]
try:
t = threading.Thread(target=trick, args=("Trick running", 5))
t.daemon = True
t.start()
except: Exception,
print "start up"
login
function andtry
section look empty here, please fix the indentation. – ElishaLabel
it is aTkinter
object. please add this information. in addition, try to add the lineglobal WTI
in the beginning oftrick
function – Elisha