Workingwithtext: Difference between revisions
(Created page with "<source lang="python"> #import time f = open('facebookdatapolicy.txt') print f out = open('newfilenikos.txt', 'w') #saveas for line in f: line = line.strip().lower() text ...") |
No edit summary |
||
Line 1: | Line 1: | ||
Replacing word facebook with THE WORLD WE CREATED FOR YOU TO FIT YOUR SELF COMFORTABLY from facebook data | |||
policy and output in txt | |||
<source lang="python"> | <source lang="python"> | ||
#import time | #import time |
Revision as of 18:59, 18 November 2013
Replacing word facebook with THE WORLD WE CREATED FOR YOU TO FIT YOUR SELF COMFORTABLY from facebook data policy and output in txt
#import time
f = open('facebookdatapolicy.txt')
print f
out = open('newfilenikos.txt', 'w') #saveas
for line in f:
line = line.strip().lower()
text = line.replace('facebook' , 'THE WORLD WE CREATED FOR YOU TO FIT YOUR SELF COMFORTABLY')
#time.sleep(.2)
print text
out.write(text)
out.close()