String comparison

Alexander Stirzel stirzel at mailhost.stg.rt.daimlerchrysler.com
Wed Mar 14 10:47:28 EST 2001


Hi!

I have a string processname with "netscape" in it and I want to compare
it with the written word "netscape".

This are some lines of my source code:

(...)
processname = splitted.pop()
(... no the string netscape is in processname ...)
if ((processname=="netscape") and ((string.atof(cputimeerg))>45) and
((string.atof(cpupercwert))>45)):
(... the first comparison is false ... why? ...)

I printed processname just before this comparison and I got "netscape"
on screen. (With no spaces there, that's not the problem) But when I 
>>>> print (processname=="netscape")
I get a "0" on screen. And when I 
>>>> print (processname)
I get "netscape" on screen.

This is strange...

Thanks for any help.

-- 
Alexander Stirzel 
E-Mail: alexander.stirzel at daimlerchrysler.com
*** welcome to hell, here's your copy of windows ***



More information about the Python-list mailing list