📜  python 打开文件模式 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:22.727000             🧑  作者: Mango

代码示例1
#how you can open a file n python:
open("file_name.file_extension")

# and here's the ways you can access the data from the file:
# r--> read mode
# w--> write mode
# a--> append mode

# r+--> read and write (can't delete parts)--> cursor at the beginning
# w+--> read and write (can delete file parts)
# a+--> read and append (can't delete parts)--> cursor at the end of the file

# n.b.--> to append means that you add something at the end of something else