Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. >>> fileObj = codecs.open("C:\\avignontext\\avignon.txt", "r", "utf-8")
  2. >>> line = fileObj.readline()
  3. >>> fileObj = codecs.open("C:\\avignontext\\avignon.txt", "r", "utf-8")
  4. >>> line = fileObj.readline()
  5.  
  6. >>> for word in magicwords:
  7. type(word) is str
  8.  
  9.  
  10. True
  11. True
  12. >>> for word in magicwords:
  13. if word in line:
  14. print "found"
  15.  
  16.  
  17.  
  18. Traceback (most recent call last):
  19. File "<pyshell#30>", line 2, in <module>
  20. if word in line:
  21. TypeError: 'in <string>' requires string as left operand
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement