Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

J. Cliff Dyer jcd at sdf.lonestar.org
Mon Dec 1 17:15:39 CET 2008


On Sat, 2008-11-29 at 13:31 -0800, Lie wrote:
> pdb and logging is too much for beginners, which most likely does not
> yet understand the workings of the debugger and logger (and pdb's many
> quirks). Don't forget that we're all beginners once. Python's learning
> curve shouldn't raise with time, it should get lower so more people
> can join in the board.

>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)
>>>
>>> logging.debug("HERE!")
DEBUG:root:HERE!
>>> logging.debug("THERE!")
DEBUG:root:THERE!
>>> logging.info("abc")
INFO:root:abc


Ooh.  Tough one.

The only thing that's missing is to have this clearly documented in
tutorials.  (Maybe level 2, once you've learned the basics).

And if that's too hard for you, you can still use print("HERE!").  But
why sweat the "productivity loss" of the two parens when robust logging
is really that easy, and can be turned on or off at one place?









More information about the Python-list mailing list