"""文件路径"""
# 相对文件路径(适用于打开位于不同文件夹的文件)
with open(r'1\temp.py') as file_object:
# 运用方法read读取整个文件
contents = file_object.read()
print(contents.strip(), end='')
# 绝对文件路径(完整路径,任何位置,较麻烦)
file_path = r'C:\Users\user\Desktop\pi_digits.txt'
with open(file_path) as file_object:
contents = file_