🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #28251

Re: Pytania początkującego cz. 1

#28251
From: Artur M. Piwko
Date: Sat, 12 Nov 2011 09:10
55 lines
2817 bytes
In the darkest hour on Thu, 10 Nov 2011 17:47:39 +0100,
hubert depesz lubaczewski <depesz@depesz.com> screamed:
>> import pprint
>> help(pprint)
>> help(pprint.pprint)
>
> dzięki. już kumam.
>

Polecam ipythona. Dopełnianie tabem i wiele innych rzeczy w stylu:

In [1]: import pprint
In [2]: pprint?
Type:             module
Base Class:       <type 'module'>
String Form:   <module 'pprint' from '/usr/lib/python2.7/pprint.pyc'>
Namespace:        Interactive
File:             /usr/lib/python2.7/pprint.py
Docstring:
    Support to pretty-print lists, tuples, & dictionaries recursively.
[...]

In [3]: pprint.pprint?
Type:           function
Base Class:     <type 'function'>
String Form:    <function pprint at 0x7f6e450fa410>
Namespace:      Interactive
File:           /usr/lib/python2.7/pprint.py
Definition:     pprint.pprint(object, stream=None, indent=1, width=80,
depth=None)
Docstring:
    Pretty-print a Python object to a stream [default is sys.stdout].

In [4]: pprint.pprint??
Type:           function
Base Class:     <type 'function'>
String Form:    <function pprint at 0x7f6e450fa410>
Namespace:      Interactive
File:           /usr/lib/python2.7/pprint.py
Definition:     pprint.pprint(object, stream=None, indent=1, width=80,
depth=None)
Source:
def pprint(object, stream=None, indent=1, width=80, depth=None):
    """Pretty-print a Python object to a stream [default is sys.stdout]."""
        printer = PrettyPrinter(
            stream=stream, indent=indent, width=width, depth=depth)
        printer.pprint(object)

itd...

-- 
[ Artur M. Piwko : Pipen : AMP29-RIPE : RLU:100918 : From == Trap! : SIG:232B ]
[ 10:07:22 user up 12984 days, 22:02,  1 user, load average: 0.43, 0.01, 0.64 ]

         Between two evils, I always pick the one I never tried before.
Technical Details
Message-ID: <slrnjbse0d.h65.milusi.pysiaczek@buziaczek.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <vhsqo8-di8.ln1@depesz.com> <op.v4ozxmshhilul8@asus7p.home> <ns0to8-r2o.ln1@depesz.com> <op.v4qk4jprhilul8@asus7p.home> <229to8-6ld.ln1@depesz.com> <op.v4qm52unhilul8@asus7p.home> <bqbto8-194.ln1@depesz.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "Artur M. Piwko" <milusi.pysiaczek@buziaczek.pl>
Newsgroups: pl.comp.lang.python
Subject: Re: Pytania początkującego cz. 1
Date: Sat, 12 Nov 2011 10:10:37 +0100
Organization: Petroleum Drinkers (;
Lines: 55
Message-ID: <slrnjbse0d.h65.milusi.pysiaczek@buziaczek.pl>
References: <vhsqo8-di8.ln1@depesz.com> <op.v4ozxmshhilul8@asus7p.home> <ns0to8-r2o.ln1@depesz.com> <op.v4qk4jprhilul8@asus7p.home> <229to8-6ld.ln1@depesz.com> <op.v4qm52unhilul8@asus7p.home> <bqbto8-194.ln1@depesz.com>
Reply-To: milusi.pysiaczek@buziaczek.pl
NNTP-Posting-Host: 81.26.9.42
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1321092498 7124 81.26.9.42 (12 Nov 2011 10:08:18 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Sat, 12 Nov 2011 10:08:18 +0000 (UTC)
X-User: pipene
User-Agent: slrn/pre1.0.0-18 (Linux)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit