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


Groups > comp.lang.python > #75032

Re: Why does not pprint work?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'variables': 0.07; '22,': 0.09; 'name?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; "'__doc__',": 0.16; "'__file__',": 0.16; 'module?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thanks.': 0.20; '>>>': 0.22; 'python?': 0.22; 'header:User- Agent:1': 0.23; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; "skip:' 10": 0.31; 'invoke': 0.31; 'yes.': 0.31; 'there': 0.35; 'curious': 0.36; 'subject:?': 0.36; 'two': 0.37; 'list': 0.37; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'how': 0.40; 'then,': 0.60; 'first': 0.61; 'name': 0.63; 'july': 0.63; 'within': 0.65; 'received:pacbell.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From emile <emile@fenx.com>
Subject Re: Why does not pprint work?
Date Tue, 22 Jul 2014 15:17:49 -0700
References <6e09bc9c-d510-4076-b20d-32df796ca59e@googlegroups.com> <mailman.12199.1406065896.18130.python-list@python.org> <d7e3d1fa-29d3-4408-acb0-a85f96e57c0a@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-69-226-129-65.dsl.pltn13.pacbell.net
User-Agent Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <d7e3d1fa-29d3-4408-acb0-a85f96e57c0a@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12200.1406067501.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406067501 news.xs4all.nl 2850 [2001:888:2000:d::a6]:50138
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75032

Show key headers only | View raw


On 07/22/2014 03:05 PM, fl wrote:
> On Tuesday, July 22, 2014 5:51:07 PM UTC-4, emile wrote:
>> On 07/22/2014 02:42 PM, fl wrote:
>> pprint is a module name -- you need to invoke the pprint function from
>> within the pprint module:
>> pprint.pprint(board)
>
> Thanks. I am curious about the two pprint. Is it the first pprint the name of the
> module? The second pprint is the function name?

Yes.


> Then, how can I list all the function of pprint?

use the dir builtin:

 >>> dir (pprint)
['PrettyPrinter', '_StringIO', '__all__', '__builtins__', '__doc__', 
'__file__', '__name__', '_commajoin', '_id', '_len', '_perfcheck', 
'_recursion', '_safe_repr', '_sys', '_type', 'isreadable', 
'isrecursive', 'pformat', 'pprint', 'saferepr']


>
> And, is there a way to list the variables I create in Python?

also dir:

 >>> dir()
['__builtins__', '__doc__', '__name__', 'board', 'mylist', 'pprint', 
'reassign']


Emile

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


Thread

Why does not pprint work? fl <rxjwg98@gmail.com> - 2014-07-22 14:42 -0700
  Re: Why does not pprint work? Chris Angelico <rosuav@gmail.com> - 2014-07-23 07:49 +1000
  Re: Why does not pprint work? emile <emile@fenx.com> - 2014-07-22 14:51 -0700
    Re: Why does not pprint work? fl <rxjwg98@gmail.com> - 2014-07-22 15:05 -0700
      Re: Why does not pprint work? emile <emile@fenx.com> - 2014-07-22 15:17 -0700
      Re: Why does not pprint work? Chris Angelico <rosuav@gmail.com> - 2014-07-23 08:19 +1000
      Re: Why does not pprint work? Chris Kaynor <ckaynor@zindagigames.com> - 2014-07-22 15:22 -0700
  Re: Why does not pprint work? Ned Batchelder <ned@nedbatchelder.com> - 2014-07-22 22:26 -0400
  Re: Why does not pprint work? Chris Angelico <rosuav@gmail.com> - 2014-07-23 15:05 +1000
  Re: Why does not pprint work? robkotenko@gmail.com - 2014-08-03 14:34 -0700
    Re: Why does not pprint work? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-03 23:49 +0100

csiph-web