Documentation for pypng

67 views
Skip to first unread message

sky...@gmail.com

unread,
Jan 3, 2014, 8:56:13 AM1/3/14
to pypng...@googlegroups.com
Hallo. The page in question is http://pythonhosted.org/pypng/ex.html#a-little-message and the "a little message" section.

I was having problems following the example, in that pasting into python3.3 on OS X gives an error.

After pasting in the line:

w = png.Writer(len(s[0]), len(s), greyscale=True, bitdepth=1)

I get the error:

TypeError: 'map' object is not subscriptable

I got it to work by renaming the output of the map() function to s2 then using that in the Writer() method.

Just wondering if it is due to my version of Python or if the documentation is at fault. I'm a beginner so this was pretty confusing for me.

Thanks in advance!

David Jones

unread,
Jan 3, 2014, 11:16:32 AM1/3/14
to pypng...@googlegroups.com
On 3 January 2014 13:56, <sky...@gmail.com> wrote:
> Hallo. The page in question is
> http://pythonhosted.org/pypng/ex.html#a-little-message and the "a little
> message" section.
>
> I was having problems following the example, in that pasting into python3.3
> on OS X gives an error.

It's probably that you're using Python 3.3 and when I wrote the
examples I was using Python 2.x. Not soon, but at some point, I'll
change the documentation so that it's clear that they are Python 2.x
and add some hints for Python 3.x users.

Thanks for trying pypng!

drj
Reply all
Reply to author
Forward
0 new messages