Better way / regex to extract values form a dictionary

Ganesh Pal ganesh1pal at gmail.com
Sat Jul 21 08:39:00 EDT 2018


> The dictionary is irrelevant to your question. It doesn't matter whether
> the path came from a dict, a list, read directly from stdin, an
> environment variable, extracted from a CSV file, or plucked directly from
> outer space by the programmer. The process remains the same regardless of
> where the path came from.
>


Thanks I was ignorant about this  , your solution looks cool .  One last
question , does it makes sense to check if the values are not none ( If I
plan to use the value for next computation )

 if not all(filename, testcase):
               raise ValueError("Error getting filename or testcase no")


Regards,
Ganesh



More information about the Python-list mailing list