如何使用ConfigParser将值设置为None?

Par*_*rth 6 python configparser

我在Python 2.7中使用ConfigParser从配置文件中读取,我想知道如何读取一个值,使其None在Python中设置为常量.

目前,我的代码如下:

config.set("Test Series Parameters", "Test Series Parameter", None)
Run Code Online (Sandbox Code Playgroud)

但是,这显示为Test Series Parameter = "None"(作为字符串).

Car*_*los 15

根据2.7.2文档:

何时allow_no_valuetrue(默认False值:),接受没有值的选项; 为这些提供的价值是None.这有帮助吗?