Reputation: 1266
I'm using ConfigParser in Python 2.7 to read from a config file and I'm wondering how to read a value such that it's set to the constant None
in Python.
Currently, my code is as follows:
config.set("Test Series Parameters", "Test Series Parameter", None)
However, this shows up as Test Series Parameter = "None"
(as a string).
Upvotes: 10
Views: 9962
Reputation: 1935
According to the 2.7.2 docs:
When
allow_no_value
istrue
(default:False
), options without values are accepted; the value presented for these isNone
. Does that help?
Upvotes: 22