Bash ~ Perl ~ Python ~ Batch ~ Ruby
Tuesday, 17 September 2013
python find and replace with return type
import re
def sam(file):
return re.sub(":"," ", file)
f=open("/etc/passwd","r")
for i in f.readlines():
s=sam(i)
print s
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment