在我试过的 django shell 上
from django import forms
class A(forms.Form):
x = forms.CharField()
ao = A()
import pdb
pdb.run('ao.as_table')
但是在最后一条语句中,在第一次点击继续后,我得到了一个堆栈跟踪
/usr/lib/python2.6/pdb.pyc in run(statement, globals, locals)
1218
1219 def run(statement, globals=None, locals=None):
-> 1220 Pdb().run(statement, globals, locals)
1221
1222 def runeval(expression, globals=None, locals=None):
/usr/lib/python2.6/bdb.pyc in run(self, cmd, globals, locals)
370 cmd = cmd+'\n'
371 try:
--> 372 exec cmd in globals, locals
373 except BdbQuit:
374 pass
/usr/lib/pymodules/python2.6/IPython/FakeModule.pyc in <module>()
NameError: name 'ao' is not defined
什么地方出了错 ?:(