@PyNoobs: The Fundamental Five Built-in Functions, and Beyond!

Thomas Jollans t at jollybox.de
Wed Jul 27 02:39:53 CEST 2011


Beyond!

On 27/07/11 02:01, rantingrick wrote:
> --------------------------------------------------
> 1. help()
> --------------------------------------------------
> --------------------------------------------------
>  2. dir()
> --------------------------------------------------

Pro tip: the "IPython" enhanced Python shell makes these two even more
amicable.

> --------------------------------------------------
>  3. repr()
> --------------------------------------------------
> http://docs.python.org/py3k/library/functions.html#repr
> 
> Most new user think that printing an object to stdout is all they'll
> ever need. 

Also handy: the "pprint" stdlib module to pretty-print complex structures.

http://docs.python.org/py3k/library/pprint.html

> --------------------------------------------------
>  5. id()
> --------------------------------------------------

This reminds me of something I did last year. Some of you might recall.
http://blog.jollybox.de/archives/62-python-swap
(Word of warning: bad idea. Very, very bad idea. Still, potentially
amusing. Kind of like blowing up a giant hydrogen-filled baloon.)



More information about the Python-list mailing list