文件看起来像这样
637 C0205088:Terminal (End-stage) [Qualitative Concept]
637 C0439095:Alpha (Greek letter alpha (qualifier value)) [Intellectual Product]
840 C0596072:amino group [Inorganic Chemical]
答案 0 :(得分:0)
尝试以下代码:
with open(r"filepath" , 'rb') as fp:
for line in fp:
print line.strip()