3
我試圖打開一個文件,並從該文件 得到的第一個字,然後比較,如果是同一個詞 即source_index.txt麻煩,爲了使用一個元件分離列表它
TTTGATTAAT , source-document01012.txt , 0 , 9
TAATAGTTAG , source-document01012.txt , 6 , 15
TTAGTTTACT , source-document01012.txt , 12 , 21
並獲得TTTGATTAAT以便稍後使用。
通過使用索引1 [0],它給我的整行從代碼
with open ('source_index.txt', 'r') as fsource:
index1 = [line.strip().split(",") for line in fsource]
with open ('susp_index.txt', 'r') as fsusp:
index2 = [line.strip().split(",") for line in fsusp]
if index1[0] == index2[0]:
提取物。我究竟做錯了什麼?
這奏效了,謝謝! – robins02
當你這樣分裂時,你會在最後得到一個空間。你會得到「TTTGATTAAT」而不是「TTTGATTAAT」 – Keatinge