Printing modules contents

Michael Hudson mwh21 at cam.ac.uk
Thu Dec 7 07:52:37 EST 2000


joonas <keisari_ at hotmail.com> writes:

> How can I make a script that would print modules contents like below,
> 
> sys
>   sys.__name__ = "sys"
>   sys.stdout = "<PyShell.PseudoFile instance at 7fd530>"
>   sys.winver = "1.5"
>   sys.etc = "spam"

Think "dir" & "repr".  Shouldn't be hard.

Cheers,
M.

-- 
39. Re graphics:  A picture is worth 10K  words - but only those 
    to describe the picture. Hardly any sets of 10K words can be 
    adequately described with pictures.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list