Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. __author__ = 'Bishop'
  2. #volgio reggere il testo da un file:
  3. import urllib
  4.  
  5. def read_file():
  6. #c'e una funzione nella libreria di pitone: open() per aprire i file,
  7. #chiamo il file aperto check:
  8. check = open(r"C:\Users\Bishop\Documents\Universita\PITONE\es5\check.txt")
  9. #uso la funzione read sul file aperto che ho chiamato check,
  10. #chiamo quello che legge contenuto:
  11. contenuto = check.read()
  12. #print(contenuto)
  13. #e' buona norma chiudere i file aperti:
  14. check.close()
  15. shitterCheck(contenuto)
  16.  
  17. def shitterCheck(text):
  18. connection = urllib.urlopen("http://www.wdyl.com/profanity?q="+text)
  19. output = connection.read()
  20. print(output)
  21. connection.close()
  22. read_file()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement