UnboundLocalError in TKinter, SQLAlchemy script.

Chris Kavanagh ckava3 at gmail.com
Thu Mar 19 04:21:27 EDT 2015


On Wednesday, March 18, 2015 at 6:38:48 PM UTC-4, Steven D'Aprano wrote:
> On Thu, 19 Mar 2015 06:42 am, Chris Kavanagh wrote:
> 
> > While I appreciate the help greatly I thought I had put the entire
> > traceback of the error. I was posting here and on StackOverflow, and
> > suppose I got confused.
> 
> We all make mistakes. I got distracted and forgot to link you to 
> 
> http://sscce.org/
> 
> ("Short, Self Contained, Correct (Compilable), Example") which might have
> helped you understand where I was coming from.
> 
> I understand that when you're focused on fixing this one error, its hard to
> care about the big picture, but the bigger picture is that the error you
> had was actually a pretty basic problem. Learning how to debug your own
> code is the most important thing we can teach you, in the sense of the old
> proverb about giving a person a fish versus teaching them how to fish.
> 
> What I hope you learned from my post is:
> 
> - The traceback contains valuable debugging information, particularly 
>   when it shows the actual line of code that fails. If you're not 
>   reading it, you should. If you're not understanding it, you should
>   ask about it.
> 
> - Most bugs are localised, and if you can isolate the bug, not only 
>   do you help us to help you, but you may even solve the problem 
>   yourself.
> 
> - And *least important of all*, hopefully I gave you some solutions
>   to your immediate problem.
> 
> 
> > 2nd, you say you "don't want to play guessing games", yet complain about
> > "300 lines of irrelevant code", lol. Which way is it? Do you want the
> > code, or not? How do I know what's relevant or irrelevant when I'm clearly
> > confused? On Stack, if you don't post the entire code, you are asked to do
> > so. I would think it would be the same procedure here.
> 
> I'm pretty sure that on Stackoverflow they don't insist on you posting your
> entire program. What if it is 100,000 lines of code split over twenty
> files? I think they ask for the same as the SSCCE site above, a minimum
> sample of code which they can run and see the error themselves.
> 
> Have you got a solution to your immediate problem now, or are you still
> looking for help?
> 
> 
> 
> 
> -- 
> Steven

Again,thanks for the help and sorry about the mistake(s). . .No, I'm sure if the code is "10,000" lines no one want it posted no matter what site. However, mine wasn't 10,000 lines it was a relatively small piece of code, that's why I posted it. I've been admonished on S.O. for NOT posting entire code before. Of course what I've posted in the past has been relatively short examples.

No, I don't need any further help as far as the direct question goes. It was a question I should've easily figured out myself. Unfortunately due to long work hours and me doing this in the middle of the night, I got lazy. I would like to figure out how to code this better , but haven't had time to look at your links (examples) closely yet (which is greatly appreciated).

Anyways, I thought I was doing the right thing by posting all of it. You live and you learn. I know better now, lol. Thanks to all for the help.



More information about the Python-list mailing list