Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10358

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

Date 2011-07-27 02:39 +0200
From Thomas Jollans <t@jollybox.de>
Subject Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond!
References <d480e736-6b4a-42cf-85da-5563c016c711@q11g2000yqm.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1517.1311727186.1164.python-list@python.org> (permalink)

Show all headers | View raw


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.)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

@PyNoobs: The Fundamental Five Built-in Functions, and Beyond! rantingrick <rantingrick@gmail.com> - 2011-07-26 17:01 -0700
  Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond! Thomas Jollans <t@jollybox.de> - 2011-07-27 02:39 +0200
  Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-27 12:22 +1000
  Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond! Terry Reedy <tjreedy@udel.edu> - 2011-07-26 22:53 -0400
    Re: @PyNoobs: The Fundamental Five Built-in Functions, and Beyond! rantingrick <rantingrick@gmail.com> - 2011-07-28 14:34 -0700

csiph-web