📜  python 将整个文件读取为字符串 - Python 代码示例

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

代码示例1
# Open a file: file
file = open('my_text_file',mode='r')
 
# read all lines at once
all_of_it = file.read()
 
# close the file
file.close()