while True:
print "Enter Text"
c = raw_input()
print 'Text entered is:'
print c
if c[-1] == '.':
break
def EOF():
return -1
while True:
print "Enter Text"
c = raw_input()
print 'Text entered is:'
print c
if c != EOF():
break
print "Key in Text:"
f = open('myfile','w')
c=str(raw_input())
f.write(c)
print "The text is:"
f = open('myfile','r')
print f.read()
f.close()
def file_output(x):
f=open(x,"r")
print f.read()
original = open('stud_rec','w')
copy = open('image','a')
original.write("Tirupparankundram\n")
copy.write("Tirupparankundram\n")
original.close()
copy.close()
print "After adding input,stud_rec has: "
file_output("stud_rec")
print "After append,image contains:"
file_output("image")
print "Type in the Text:"
f = open('madurai','w')
c=str(raw_input())
f.write(c)
print "The text read as:"
f = open('madurai','r')
print f.read()
f.close()
import os
import sys
import fileinput
import string
print "Madurai Contains :"
f = open('madurai_1','r')
print f.read()
f.close()
s = open("madurai_1").read()
s = s.replace('temple', 'shrine')
f = open("madurai_1", 'w')
f.write(s)
f.close()
print "Modified File now reads :"
f = open('madurai_1','r')
print f.read()
f.close()
import re
print "Enter a stream of characters with integers embedded"
c=raw_input()
print "Integr is : ",re.sub("[^0-9]", "", c)