Converting from a string to boolean in Python?
Really, you just compare the string to whatever you expect to accept as representing true, so you can do this: Or to checks against a whole bunch of values: Be cautious when using the following: Empty strings evaluate to False, but everything else evaluates to True. So this should not be used for any kind of parsing … Read more