close

f = open('test.txt', 'r')

lines = f.read().splitlines()  #分行讀取

lst = [ln.split(' ')[0] for ln in lines] #依據空格做切割字串,並只取第一個切割的值

arrow
arrow

    楓綺 發表在 痞客邦 留言(2) 人氣()