Python - if/else statements

dmbkiwi dmbkiwi at yahoo.com
Sat Jul 12 20:30:52 EDT 2003


On Sat, 12 Jul 2003 23:11:20 +0000, Bengt Richter wrote:

> On Sat, 12 Jul 2003 14:27:33 +1200, dmbkiwi <dmbkiwi at yahoo.com> wrote:
> 
>>On Sat, 12 Jul 2003 01:58:13 +0000, Bengt Richter wrote:
>>
> [...]
>>> If that is really happening, I wonder if you are somehow executing code from a different version
>>> or have some kind of mixed-up installation. Or are using incompatible extension modules?
>>> Do you have multiple versions installed? what are your versions, and what sym links are there?
>>> And what are the #! lines of your script(s)?
>>
>>One point that I may not have made clear is that I'm not experiencing this
>>behaviour personally with my set up.  It is other people using this script
> Is it a single .py file?

Yes, although it imports a module called karamba (see my original post -
this is a theme run through a theme engine called superkaramba).

> 
>>who are reporting this behaviour.  The difficulty I'm having is that it's
>>very hard to debug a problem you're not having.  I've sent versions of the
>>script to these people, with print statements at appropriate points to
>>ensure that the script is doing what I think it's doing (in terms of going
>>wrong for them), and from the output they send back, the interpreter is
>>definitely ignoring the else statement and ploughing through them, even
>>though, it's also executed the corresponding if statement.
>>
> I wonder if your script is executed directly by Python. Perhaps it is "sanitized"
> for security reasons before being executed in some context, and it gets glitched,
> in the sanitizing process. If so, could you ask them to put a debug print to
> show what's actually being executed? And ask them how it's being executed
> (ie, exec vs exec in somedir vs execfile vs import and invoke vs whatever they do).

It is being executed through the superkaramba engine (written in c++ I
believe).  Not sure if I, or my users have enough gumption to do the
debugging you are referring to.  I have asked them to execute the script
which contains a number of print statements to verify that it is ignoring
the else statement.  Is there other debugging info that I should be
printing when running the script?

> [...]
>>Suffering alone exists, none who suffer;
>>The deed there is, but no doer thereof;
>>Nirvana is, but no one is seeking it;
>>The Path there is, but none who travel it.
>>		-- "Buddhist Symbolism", Symbols and Values
>>
> Cool ;-)
> 
> Regards,
> Bengt Richter

Glad you liked it.  It's just an automated sig generated by the fortune
program.  No conscious thought goes into it :-).

Matt




More information about the Python-list mailing list