Re: if..else stmt

2007-10-22 Thread Bruno Desthuilliers
bigden007 a écrit : > Hi, > I have a if..else statement in my script. The statements all execute > fine, but the problem is , even if the IF part of the statement is > true, the else part executes as well. The verion of pythin i use 2.5 > Any help is appreciatiated. My crystal ball tells me the pr

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
bigden007 wrote: > Hi, > I have a if..else statement in my script. The statements all execute > fine, but the problem is , even if the IF part of the statement is > true, the else part executes as well. The verion of pythin i use 2.5 > Any help is appreciatiated. > > Regards > > Big Den. > > You

Re: if..else stmt

2007-10-22 Thread Sander Smits
Works as expected here, the 'else' part is not executed if the 'if' part is true. Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def tr(): ... p

Re: if..else stmt

2007-10-22 Thread J. Cliff Dyer
Your else statement is incorrectly indented. The interpreter treats it as part of the for-loop construct inside the if statement rather than as part of the if statement itself. See the recent thread about for-else constructs for more details. If your problem is not obvious yet, make sure you are

Re: if..else stmt

2007-10-22 Thread Erik Max Francis
bigden007 wrote: > I have a if..else statement in my script. The statements all execute > fine, but the problem is , even if the IF part of the statement is > true, the else part executes as well. The verion of pythin i use 2.5 > Any help is appreciatiated. You're doing something wrong. Without