酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

读取在config目录下的config_r.txt中的内容

```python import os # 获取当前脚本所在的目录 current_dir = os.path.dirname(os.path.abspath(__file__)) # 构建config_r.txt文件的完整路径 config_file_path = os.path.join(current_dir, 'config', 'config_r.txt') # 读取文件内容 with open(config_file_path, 'r') as file: content = file.read() print(content) ``` [2024-07-04 15:43:48 | AI写代码神器 | 115点数解答]

相关提问