正文

Python调用文件的方法有很多,以下是一些常见的方式: 1. 读取文件内容: ```python with open('example.txt', 'r') as file: content = file.read() print(content) ``` 2. 写入文件内容: ```python with open('example.txt',