Use python code to generate locals for pdb