📜  在 python 代码示例中打开和读取文件

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

代码示例6
my_file = open("C:\\Users\\Python\\file.txt", "r")
#Give the path accurately and use \\
text = my_file.read()
print(text)

#Output: The text in file.txt will be printed