小编Man*_*dal的帖子

Python 3 configparser 中的 read 和 read_file 有什么区别?

我想知道 configparser 中 read 和 read_file 的使用有什么区别。据我测试过

config_parser = configparser.ConfigParser()
config_parser.read(config_file)
Run Code Online (Sandbox Code Playgroud)

config_parser = configparser.ConfigParser()
config_parser.read_file(config_file)
Run Code Online (Sandbox Code Playgroud)

两者都适合我。config_file 是我作为输入参数传递的 config_file 的名称。

python configparser python-3.x

7
推荐指数
1
解决办法
7178
查看次数

标签 统计

configparser ×1

python ×1

python-3.x ×1