When you want to find a word in a string, use find()

e.g.

import sys
arg1 = sys.argv[1] # passing the first argument

if arg1.find("off") == -1: # if arg1 does not contain "off"
# do something
else:
# do something

26 Responses to “Find word in a string (Python)”

  1. shimmy@adalat.simone” rel=”nofollow”>..

    Buyit now…

  2. buy@cheap.viagra.in.uk” rel=”nofollow”>.

    Buywithout prescription…

  3. prozac@dangers.now” rel=”nofollow”>..

    Buygeneric drugs…

  4. Zyvox@official.site” rel=”nofollow”>..

    Buygeneric pills…

  5. Synthroid

    Buygeneric pills…

  6. Retin A

    Buywithout prescription…

  7. Remeron

    Buyno prescription…

  8. purim suddah

    Buygeneric meds…

  9. Synthroid

    Buygeneric meds…

  10. Eye Drops

    Buyno prescription…

  11. Pulmicort

    Buywithout prescription…

  12. Synthroid@Synthroid.Synthroid” rel=”nofollow”>..

    Buynow it…

  13. Spiriva@Spiriva.Spiriva” rel=”nofollow”>..

    Buyno prescription…

  14. Buygeneric meds…

  15. chantix@vs.zyban” rel=”nofollow”>..

    Buyit now…

  16. retin@a.cheap.no.prescription” rel=”nofollow”>..

    Buygeneric drugs…

  17. order@altace.cod” rel=”nofollow”>..

    Buynow…

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 Web Oom Suffusion theme by Sayontan Sinha
Switch to our mobile site
Top Footer