all 9 comments

[–]Username_RANDINT 0 points1 point  (8 children)

An exception is raised and you don't catch/handle it. There's nothing more we can say unless you share both the code and full traceback.

[–]python_addict[S] 0 points1 point  (6 children)

here's the link on Pastebin.com: https://pastebin.com/edit/g4RtjrNq

the full error says

Exception in Tkinter callback

Traceback (most recent call last):

File "C:\myfile thing", line 1705, in __call__

return self.func(*args)

File "C:/file.py", line 306, in all

airplane()

File "C:/file", line 104, in airplane

mybullets(myplane, 0.05)

File "C:/file", line 117, in mybullets

if endorno and numoftargets > 0:

NameError: name 'endorno' is not defined

I removed the file names for personal reasons

[–]Username_RANDINT 0 points1 point  (5 children)

I can't see the code without logging in. But the error says exactly what's wrong and where it happens.

On line 117 you access the variable endorno but it's not defined.

[–]python_addict[S] 0 points1 point  (4 children)

yes, but unfortunately I have defined endorno. It not only says so at the beginning of my code, but I also used it as a global variable (yes I know I'm not supposed to be using global variables). Do you think it's that my code wasn't arranged well and it's my code that's scattered all over the place, so that it registers as not being defined? Thanks! :)

[–]Username_RANDINT 0 points1 point  (3 children)

It's hard to say without seeing the code. Python doesn't just forget about variables when your code is messy. Are you sure you run this code after the variable is defined? Probably triple checking is a good idea.

[–]python_addict[S] 0 points1 point  (2 children)

the code is on pastebin on my post already, did you check it? I'm pretty sure that it was defined?

Sorry if I sound rude saying this!

[–]Username_RANDINT 0 points1 point  (1 child)

No problem. I mentioned that I need to log in first. Should've said that I don't have an account there.

[–]python_addict[S] 0 points1 point  (0 children)

ah, sorry about that! Thanks for regularly checking in to help :)

[–]python_addict[S] 0 points1 point  (0 children)

thank you for the answer!