Best way to print a module?

Tim Roberts timr at
Mon Sep 5 16:07:15 EDT 2011

Martin De Kauwe <mdekauwe at> wrote:
>If I wanted to print an entire module, skipping the attributes
>starting with "__" is there an *optimal* way? 

Your question is somewhat ambiguous.  When I read "print an entire module",
I assumed you were asking for a way to print the source code, perhaps with
syntax coloring.

Surely there is no reason to have an "optimal" method of doing this -- this
is never going to be in an inner loop.  If you have a method that works,
there is little justification to optimize...
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list