[問題] 讀檔

看板Python作者 (我願意對妳好)時間18年前 (2006/04/02 13:43), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
我的txt檔中有這樣的數據 19.2784649017 19.340909049 17.3025351552 2.9427 我想要程式讀出來是這樣的情況 c=19.2784649017 g=19.340909049 p=17.3025351552 v=2.9427 可是我輸出的情況卻不能顯示這樣 以下是我的程式碼: inputfile=open('D:\data3.txt','r') s=list(inputfile.read()) print s 請大大看看有什麼問題 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.23.28.20

04/03 03:38, , 1F
c,g,p,v = [float(i) for i in inputfile.read().split()]
04/03 03:38, 1F
文章代碼(AID): #14BsHlEP (Python)
討論串 (同標題文章)
以下文章回應了本文
問題
3
3
完整討論串 (本文為第 1 之 2 篇):
問題
1
1
問題
3
3
文章代碼(AID): #14BsHlEP (Python)