import os
pwd1 = str()
pwd2 = None
pwd3 = ""
pwd4 = " "
print("1:%s" %pwd1)
print("2:%s" %pwd3)
print("3:%s" %pwd3)
print("4:%s" %pwd4)
Test.txt file contents:
[Section1]
username : testuser
password : validpwd
[Section2]
username : testuser
password : validpwd
[Section3]
username : testuser
password :
[Section4]
username : testuser
password : validpwd
Section3
contains password :
as empty line.
I have parsed the value of the "password" field from Section3
, and when I tried to print the "password" value, it prints as empty line in output. I need it to mention it as "None". How can I do that?