geneidnameF = open('geneidname.txt', 'rU')
geneidnamenewF = open('geneidnamenew.txt', 'w')
count = 1
for line in geneidnameF:
if line[-2] == 'C':
line = [ch for ch in line]
line [-2] = 'c'
line = ''.join(line)
print count
count = count + 1
geneidnamenewF.write(line)
# past the loop 'line' will contain
# the last line read from geneidnameF
print repr(line) # repr() will show \n and \r chars, etc.
geneidnameF.close()
# geneidnamenewF.flush()
geneidnamenewF.close()
|