getting the value of an attribute from pdb

Gary Wessle phddas at yahoo.com
Wed May 17 23:05:52 EDT 2006


Hi

how can I "using pdb" get a value of an attribute?, read the docs and
played around with pdb 'p' for no avail.

thanks

class main:
  def __init__(self, master):
    self.master = master
    self.master.title('parent')
    self.master.geometry('200x150+300+225')
...
root = Tk()

****************
****************
ignore the following if you are not interested on how I tried
****************
****************
(Pdb) n
> /home/fred/python/practic/window_08.py(12)__init__()
-> self.master.geometry('200x150+300+225')
(Pdb) p root.title
<bound method Tk.wm_title of <Tkinter.Tk instance at 0xb717c16c>>
(Pdb) p root.title[Tk.wm_title]
*** TypeError: <exceptions.TypeError instance at 0xb717c3cc>
(Pdb) p root.title[wm_title]
*** NameError: <exceptions.NameError instance at 0xb717c3cc>
(Pdb) p root[wm_title]
*** NameError: <exceptions.NameError instance at 0xb717c3cc>
(Pdb) p root['wm_title']
*** TclError: <_tkinter.TclError instance at 0xb717c3cc>
(Pdb) p self.master[title]
*** NameError: <exceptions.NameError instance at 0xb717c3cc>
(Pdb) p self.master['title']
*** TclError: <_tkinter.TclError instance at 0xb717c40c>
(Pdb) p self.master["title"]
*** TclError: <_tkinter.TclError instance at 0xb717c42c>
(Pdb) p self.master[wm_title]
*** NameError: <exceptions.NameError instance at 0xb717c42c>
(Pdb) p self.master['wm_title']
*** TclError: <_tkinter.TclError instance at 0xb717c3cc>
(Pdb) p self.master["wm_title']
*** SyntaxError: <exceptions.SyntaxError instance at 0xb717c3cc>
(Pdb) p self.master["wm_title"]
*** TclError: <_tkinter.TclError instance at 0xb717c40c>
(Pdb) q
Traceback (most recent call last):
  File "./window_08.py", line 65, in ?
    main(root) 
  File "./window_08.py", line 12, in __init__
    self.master.geometry('200x150+300+225')
  File "./window_08.py", line 12, in __init__
    self.master.geometry('200x150+300+225')
  File "/usr/lib/python2.4/bdb.py", line 48, in trace_dispatch
    return self.dispatch_line(frame)
  File "/usr/lib/python2.4/bdb.py", line 67, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit
****************
****************



More information about the Python-list mailing list