Python內建函式open()可以開啟指定檔案,以便進行檔案內容的讀取、寫入和修改。語法為: ... f = open('file1.txt', 'r') s = f.read(5) #前5個字元print(s) f.close() ...
確定! 回上一頁