我想知道 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 的名称。