Find word in a string (Python) How to round the number in Python?
Dec 222009

Use writelines()

e.g.

# read lines in a file
import sys
arg1 = sys.argv[1]

f = open(arg1, 'r')

lines = f.readlines()
f.close()

arg='out_'+arg1
FILE=open(arg,'w')

for line in lines:
words = line.split(' ')
if words[1] == 'hypnos':
FILE.writelines(line)
FILE.close()

Posted by weboom at 2:53 pm Tagged with: ,

Leave a Reply

(required)

(required)

Switch to our mobile site
Top Footer