Help with pydb

Keith Verheyden keith.verheyden at ntlworld.com
Fri Sep 15 00:17:45 CEST 2000


I am experiencing a fundamental problem with pydb. Can anyone help?

Why, in this simple piece of code, does the assignment foo = 666 fail to
alter foo?

#---------------
kverheyd at debian:~/progs/pyth$ pydb simple.py
(Pdb) file simple.py
(Pdb) list
  1     #!/usr/bin/python
  2
  3     def gumby():
  4
  5             foo = 42
  6             print foo
  7
  8     if __name__ == '__main__':
  9             gumby()
[EOF]
(Pdb) break 6
Breakpoint 1, at simple.py:6.
(Pdb) run
Starting program:
Issue "continue" command
(pydb) cont
Issue "continue" command
(pydb) cont
Breakpoint 1, gumby() at simple.py:6
6    print foo
(pydb) p foo
42
(pydb) foo = 666
(pydb) p foo
42
(pydb)

Its driving me nuts!







More information about the Python-list mailing list