[Tutor] broken script - curiouser and curiouser

Chris Fuller cfuller084 at thinkingplanet.net
Thu Jul 7 22:45:46 CEST 2011


TWO HOURS??  You aren't a Real Programmer 
(http://www.catb.org/jargon/html/story-of-mel.html) until you've spent a whole 
day debugging something trivial.

Heck, I quite recently spent a day plus trying to figure out why my 
microcontroller project wasn't working right. I was using a command line tool 
to tell it what functions to execute, settings to set, etc. But it didn't 
produce any sensible output. No communication errors were reported, and the 
code looked fine. It even echoed back the updated settings correctly. I finally 
realized that each invocation of the command line tool opened and closed the 
serial port, which had the effect of resetting the microcontroller! So, 
anything saved in volatile memory was naturally lost!

Ok, maybe that was just plain old boneheadery.

Cheers

On Thursday 07 July 2011, Lisi wrote:
> On Thursday 07 July 2011 15:42:12 Michael M Mason wrote:
> > > Maybe you've been editing ex25 and then executing ex26. That'd get you
> > > the same error in the same place over and over again.
> > 
> > Looks like this might be it. In your earlier post the error reported is
> > in ex26:-
> > 
> > : lisi at Tux:~/Python/LearnPythonTheHardWay$ python ex26.py
> > :   File "ex26.py", line 10
> > :     def print_first_word(words)
> > :                               ^
> > : SyntaxError: invalid syntax
> > : lisi at Tux:~/Python/LearnPythonTheHardWay$
> 
> Doh! Thank you , Michael.  The book does say something along the lines of
> "If you are stuck, leave it, take a break and come back to it later".
> 
> Still, at least I can learn from my mistakes. ;-)  That is my story anyway,
> and I'm sticking to it.
> 
> Many years ago, in the days of the ark, when men were real men, and
> programming meant writing strings of 0s and 1s and then shifting pins
> around a board, I once spent over two hours trying to discover what was
> wrong with my code in just one spot.
> 
> At the end of the over 2 hours it finally dawned on me that my code was
> fine - the memory location for that particular pin was faulty.
> 
> Lisi
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list