Why does not pprint work?

fl rxjwg98 at gmail.com
Tue Jul 22 23:42:02 CEST 2014


I read web tutorial at: 


I enter the example lines of that website:

import pprint
board = [ [0]*8 ] * 8

It echos error with Python 2.7:

Traceback (most recent call last):
  File "C:\Python27\Lib\SITE-P~1\PYTHON~2\pywin\framework\scriptutils.py", 
line 323, in RunScript
    debugger.run(codeObject, __main__.__dict__, start_stepping=0)
  File "C:\Python27\Lib\SITE-P~1\PYTHON~2\pywin\debugger\__init__.py", 
line 60, in run
    _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
  File "C:\Python27\Lib\SITE-P~1\PYTHON~2\pywin\debugger\debugger.py", 
line 655, in run
    exec cmd in globals, locals
  File "C:\cygwin64\home\Jeff\Python_lesson\ppn.py", line 1, in <module>
    import pprint
TypeError: 'module' object is not callable

It has similar error with Python 3.4.1.

Why does pprint not work?


More information about the Python-list mailing list