0

Is it possible save the evolution of constants of a program, a small one indeed, in one file ? In other word, is there a way to store the informations sent by pdb?

Suppose for example that we have the following code.

a = 1
b = 2
a = a + b

I would like to have something like the following.

a initialized to 1
b initialized to 2
a + b stored in a

1 Answers1

1

I'm a little confused about what, exactly, you're asking. But it sounds like you want to implement logging.

BenDundee
  • 4,389
  • 3
  • 28
  • 34
  • Ok, then you definitely want logging. – BenDundee Mar 16 '13 at 19:29
  • The main problem now is to have this information from `pdb`. No ? –  Mar 16 '13 at 19:36
  • What do you mean "get the information from pdb"? Just put logging statements in your code, and direct the output to a file, or the console. – BenDundee Mar 16 '13 at 23:21
  • Precisely, I do not want to do this. I really want to delegate the job to `pdb` which, I think, could do it for me. –  Mar 17 '13 at 08:39
  • I'm still confused about "getting the ingormation from pdb". Does pdb _have any information? I've only ever used it to set break points, then manually query the state of the locals. Reading the doc, it's not clear to me that the module does anything but that. So it looks like the only way to grab the states of the local variables is to write logging statements. – BenDundee Mar 17 '13 at 14:22
  • I will play with `pdb`to see if it is possible to do what I'm looking for. –  Mar 17 '13 at 14:44
  • Be sure and update this question with the solution to your problem---I'd be very interested about that capability, if it exists. – BenDundee Mar 17 '13 at 19:25
  • I will work on that this week. If I don't post something this friday, just post something here. –  Mar 17 '13 at 19:27