[Tutor] Early exiting problem. Code must be run in distinct batches

Daniel Coughlin kauphlyn@speakeasy.org
Thu, 30 May 2002 16:45:31 -0700 (PDT)


Perhaps you could include all of your program code. And describe more 
specifically what is happening. 


What are you trying to accomplish? 
Does brokendef() rely on values set in test() which might not be getting set 
correctly?
Are you getting errors? 



On Thu, 30 May 2002, Roger Mallett wrote:

> I have a def that when run with a series of other defs *always* exit early.
> 
> For example:
> 
>     if __name__ == '__main__':
>         test()
>         brokenDef()   #terminates early
> 
> I the example above, brokenDef() terminates early.
> 
> So, then I comment out brokenDef() and run test() alone, followed by commenting out test() and running brokenDef() alone, and all is well, I get what I want I just have two distinct runs:
> 
> That is:
>     if __name__ == '__main__':
>         test()
>         #brokenDef()
> 
> followed by:
>     if __name__ == '__main__':
>         #test()
>         brokenDef()
> 
> 
> I've also tried sandwiching as follows to no avail:
>     if __name__ == '__main__':
>         test1()
>         brokenDef()
>         test2()
> 
> in this case, test1() runs fine, brokenDef() terminates early, and test2() runs fine.
> 
> 
> I don't understand what types of things might get in the way.  I've checked available memory and I am only using 134meg of the 256 available.
> 
> Has anyone seen similar behavior and if so what might I look for?
> 
> Roger Mallett
> 
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>