fix line=line.rstrip('\r\n') for posix and windows systems.

This commit is contained in:
Wen-Yu Chung
2008-02-22 01:16:47 +00:00
parent 1b7f9083bb
commit 1bb153a949
2 changed files with 2 additions and 2 deletions
@@ -15,7 +15,7 @@ def parse_fasta_format(file_handle):
tmp_seq = ''
tmp_seq_count = 0
for i, each_line in enumerate(file_handle):
each_line = each_line.rstrip('\n')
each_line = each_line.rstrip('\r\n')
if (each_line[0] == '>'):
if (len(tmp_seq) > 0):
tmp_seq_count += 1
+1 -1
View File
@@ -30,7 +30,7 @@ def __main__():
out = open( outfile, 'w' )
for i, line in enumerate( open( infile ) ):
line = line.rstrip( '\n' )
line = line.rstrip( '\r\n' )
fields = line.split()
fasta_title = []
for j in title_col_list: