pwtools.common.tobool

pwtools.common.tobool(val)[source]

Convert val to boolean value True or False.

Parameters:

val (bool, string, integer) – ‘.true.’, ‘1’, ‘true’, ‘on’, ‘yes’, integers != 0 -> True ‘.false.’,’0’, ‘false’, ‘off’, ‘no’, integers == 0 -> False

Return type:

True or False

Notes

All string vals are case-insensitive.