logo
Loading...

關於python open功能中的file mode參數 - Cupoy

關於我們用open在python中匯入參數時,其中有一個file mode參數例如:open("fi...

ml100-3,ml100-3-d05

關於python open功能中的file mode參數

2019/08/31 上午 10:58
機器學習共學討論版
林敬堯
觀看數:80
回答數:1
收藏數:0
ml100-3
ml100-3-d05

關於我們用open在python中匯入參數時,其中有一個file mode參數

例如:

open("file.txt", "r")

open("pickle.pkl","rb")

裡面的"r"是read file的意思,但"b"我不太了解這個參數的意義

document裡面說這是binary file的意思

請問我在讀寫什麼樣的檔案時,需要加上"b"?

請問是在讀寫pickle file時才需要加"b"嗎?

回答列表