In <14cdnb6rubmduozwnz2dnuvz_gadn...@posted.grandecom> "Quin" 
<quinden...@grandecom.net> writes:

> s = f.readline()
> if 'mystring' in s: print 'foundit'
> if 'mystring' not in s: print 'not found'
> if 'mystring' in s:
>     print 'processing'

> this generates output:
> not found
> processing

> so, it doesn't find the substring, but goes into processing code anyway.

I got this output when f contained 'mystring':

  foundit
  processing

And this output when f did not contain 'mystring':

  notfound

I have no idea why it would have worked otherwise for you.  When you posted
your question, did you type the code by hand?  Perhaps you made a mistake.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gor...@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to