On 03/08/2014 22:34, robkote...@gmail.com wrote:
[snipped to bits]
Please don't top post, further would you read and action this
https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing
double line spacing and single line paragraphs, thanks.
--
My fellow Pythonistas, ask not what
With the way you have imported, you trying to use the module pprint instead of
the function pprint.pprint.
You need to use pprint.pprint or you need to import as:
from pprint import pprint
if you want to use the shorter form.
On Tuesday, July 22, 2014 5:42:02 PM UTC-4, fl wrote:
>
On Wed, Jul 23, 2014 at 12:26 PM, Ned Batchelder wrote:
>> Ned, if you're reading this: Adding the import would make the post
>> clearer. :)
>
>
> Done.
Thanks Ned!
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 7/22/14 5:49 PM, Chris Angelico wrote:
On Wed, Jul 23, 2014 at 7:42 AM, fl wrote:
I enter the example lines of that website:
import pprint
board = [ [0]*8 ] * 8
pprint(board)
Flaw in the blog post: he didn't actually specify the import line.
What you actually want is this:
from p
On Tue, Jul 22, 2014 at 3:17 PM, emile wrote:
> Then, how can I list all the function of pprint?
>>
>
> use the dir builtin:
>
> >>> dir (pprint)
> ['PrettyPrinter', '_StringIO', '__all__', '__builtins__',
On Wed, Jul 23, 2014 at 8:05 AM, 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)
>
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
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
On 07/22/2014 02:42 PM, fl wrote:
Hi,
I read web tutorial at:
http://nedbatchelder.com/blog/201308/names_and_values_making_a_game_board.html
I enter the example lines of that website:
import pprint
board = [ [0]*8 ] * 8
pprint(board)
pprint is a module name -- you need to invoke the
On Wed, Jul 23, 2014 at 7:42 AM, fl wrote:
> I enter the example lines of that website:
>
>
> import pprint
> board = [ [0]*8 ] * 8
> pprint(board)
Flaw in the blog post: he didn't actually specify the import line.
What you actually want is this:
from pprint import pprin
Hi,
I read web tutorial at:
http://nedbatchelder.com/blog/201308/names_and_values_making_a_game_board.html
I enter the example lines of that website:
import pprint
board = [ [0]*8 ] * 8
pprint(board)
It echos error with Python 2.7:
Traceback (most recent call last):
File "C:\Pyt
On 3/17/2013 1:45 PM, Peng Yu wrote:
pprint can not print defaultdict one record per line
Known issue, no progress for 2+ years. Patch not updated for default
branch (3.4). Not clear what best way forward is.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 17/03/2013 17:45, Peng Yu wrote:
Hi,
pprint can not print defaultdict one record per line. Is there some
other convenient way in python to print one record per line?
~/linux/test/python/man/library/pprint/function/pprint$ ./main.py
{'two': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Hi,
pprint can not print defaultdict one record per line. Is there some
other convenient way in python to print one record per line?
~/linux/test/python/man/library/pprint/function/pprint$ ./main.py
{'two': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 'one': [0,
1, 2,
On Wed, Jun 9, 2010 at 5:01 AM, madhuri vio wrote:
> sir what is the function of pprint???
> could you please help me out with that
>
> --
> madhuri :)
>
> rbr...@laptop:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help&q
sir what is the function of pprint???
could you please help me out with that
--
madhuri :)
--
http://mail.python.org/mailman/listinfo/python-list
Nadav Chernin wrote:
Hello, I want to print list of lists in matrix format. So I use pprint
with parameter ‘width’ for this target.
For example :
>>> data=[[1, 1, 1], [1, 1, 1], [1, 1, 1]]
>>> pprint(data,width=20)
[[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
The problem tha
On 11/25/2009 4:47 AM Nadav Chernin said...
Hello, I want to print list of lists in matrix format. So I use pprint
with parameter ‘width’ for this target.
The problem that I don’t know how to select width value, because if:
>>>data=[['one', 'one', 'o
Hello, I want to print list of lists in matrix format. So I use pprint
with parameter 'width' for this target.
For example :
>>> data=[[1, 1, 1], [1, 1, 1], [1, 1, 1]]
>>> pprint(data,width=20)
[[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
The problem that I do
On 2009-05-20 10:37, s...@pobox.com wrote:
>> I cannot get pprint to format output how I would like. pydb does. I
>> tried grepping the source but still couldn't grok it.
That's not the way pprint works. You have no control over how it arranges
its output.
>> I cannot get pprint to format output how I would like. pydb does. I
>> tried grepping the source but still couldn't grok it.
That's not the way pprint works. You have no control over how it arranges
its output. If you need something more flexible you
I cannot get pprint to format output how I would like. pydb does. I
tried grepping the source but still couldn't grok it. Here:
(Pydb) a = range(1,100)
(Pydb) pp a
[1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 3
On Nov 7, 9:45 am, rh0dium <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Perhaps it's not supposed to work like this but I thought if you
> supplied a width to pprint it would nicely format a list to the
> width.
>
> KEYS = ['search_keys', 'Section
Hi all,
Perhaps it's not supposed to work like this but I thought if you
supplied a width to pprint it would nicely format a list to the
width.
KEYS = ['search_keys', 'Section', 'site', 'Employee', 'JobClassCode',
'XBoss',
Hi,
When I try and use pprint on standard types I get varying 'quality of
output'.
Lists will wrap nicely to multiple lines as will dicts, but sets and
defaultdicts give one long unreadable line.
Is their a chance to get this changed so that more built-in types look
pretty when pr
Hi,
When I try and use pprint on standard types I get varying 'quality of
output'.
Lists will wrap nicely to multiple lines as will dicts, but sets and
defaultdicts give one long unreadable line.
Is their a chance to get this changed so that more built-in types look
pretty when pr
will be to output all the __dict__
> atributes. Using [1] as reference I have come up with the following
> but it has 2 problems, first the type call it's not generating valid
> python code and second this doesn't seems to work with pprint as it's
> just printing the string a
has 2 problems, first the type call it's not generating valid
python code and second this doesn't seems to work with pprint as it's
just printing the string as a one-liner making it equivalente as
calling repr(obj)
from pprint import pprint
class node(object):
def __init__(self,a,
Brian L. Troutwine wrote:
> The heading comment to pprint reads:
>
> # This is a simple little module I wrote to make life easier. I
> didn't
> # see anything quite like it in the library, though I may have
> overlooked
> # something. I wrote this when I was t
Brian L. Troutwine wrote:
> thank small children who sleep at night.
That seems like the kind of sentence that could become a tagline or
something, and you just have to be in the know to understand where it
comes from. :)
--
http://mail.python.org/mailman/listinfo/python-list
Brian L. Troutwine wrote:
> Is the last sentence an obscure reference or in-joke? Can someone
> explain it? I don't get it.
do you have small kids? tried doing serious programming while they're
still awake?
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire wrote:
> "Brian van den Broek" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Brian L. Troutwine said unto the world upon 19/09/06 05:30 PM:
>>
>>>The heading comment to pprint reads:
>>>
>>>#
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Brian L. Troutwine said unto the world upon 19/09/06 05:30 PM:
>> The heading comment to pprint reads:
>>
>> # This is a simple little module I wrote to make life easier.
Brian L. Troutwine said unto the world upon 19/09/06 05:30 PM:
> The heading comment to pprint reads:
>
> # This is a simple little module I wrote to make life easier. I
> didn't
> # see anything quite like it in the library, though I may have
> overlooked
> # somet
The heading comment to pprint reads:
# This is a simple little module I wrote to make life easier. I
didn't
# see anything quite like it in the library, though I may have
overlooked
# something. I wrote this when I was trying to read some heavily
nested
# tuples with fairly non-descri
Ant wrote:
> Longer, messy, and what's the actual point? Wouldn't:
>
> import pprint as pp
> pp.pprint(x)
>
> be better, standard *and* shorter?
why not just:
from pprint import pprint
pprint (x)
No need to modify the interpreter when you can pollute the globa
Ant wrote:
> Considering that the current:
>
> import pprint
> pprint.pprint(x)
>
> is hardly lengthy, I can't see how either of the alternatives proposed
> are any better.
>
>> python.pprint.pprint(x)
>
> 6 characters shorter, but considerably more
Considering that the current:
import pprint
pprint.pprint(x)
is hardly lengthy, I can't see how either of the alternatives proposed
are any better.
> python.pprint.pprint(x)
6 characters shorter, but considerably more keystrokes if you are using
pprint more than once. Is it worth ad
It has been proposed to replace the current print statement with a
print function for python 3.0.
http://www.python.org/dev/peps/pep-3100/
>From BDFL state of the python union:
"
print x, y, x becomes print(x, y, z)
print >>f, x, y, z becomes print(x, y, z, file=f)
"
--
http://mail.python.org/ma
the py.std prefix as well.
It's a good point not to pollute the builtin namespace with too much, so
I think I'd rather just import pprint when needed instead of using the
py.std call.
--
http://mail.python.org/mailman/listinfo/python-list
Tim Golden wrote:
> Duncan Booth wrote:
>> Personally I'd just like to see 'python' a builtin shorthand for
>> importing a name you aren't going to use much
>> e.g.
>>
>> python.pprint.pprint(x)
>
> I think that's what the py.lib people have done with
> their py.std module:
>
> http://codesp
Duncan Booth wrote:
> Personally I'd just like to see 'python' a builtin shorthand for importing
> a name you aren't going to use much
> e.g.
>
> python.pprint.pprint(x)
Would you settle for
import py
py.std.pprint.pprint(x) ?
http://codespeak.net/py/current/doc/misc.html#the-py-std-hook
Duncan Booth wrote:
> John Salerno wrote:
>
> > Just wondering if this will ever happen, maybe in 3.0 when print becomes
> > a function too? It would be a nice option to have it available without
> > importing it every time, but maybe making it a builtin violates some
> > kind of pythonic ideal?
>
John Salerno wrote:
> Just wondering if this will ever happen, maybe in 3.0 when print becomes
> a function too? It would be a nice option to have it available without
> importing it every time, but maybe making it a builtin violates some
> kind of pythonic ideal?
There are so many things whic
Just wondering if this will ever happen, maybe in 3.0 when print becomes
a function too? It would be a nice option to have it available without
importing it every time, but maybe making it a builtin violates some
kind of pythonic ideal?
--
http://mail.python.org/mailman/listinfo/python-list
45 matches
Mail list logo