文件的基本读写 path = r'C:\Users\Brady\Documents\tmp' with open(path + r'\demo.txt', 'r', encoding='utf-8') as f: content = f.read() print(content) open()函数 open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=No…