[IPython-dev] [Notebook 1.0.0] Display two png images side by side

Francesco Montesano franz.bergesund@gmail....
Fri Sep 13 09:04:25 CDT 2013


Dear Zoltan,

I forgot about the link. Anyway, the last problem wasn't about merging a
base64 object and a string (the suggestion in Stefan mail worked). I was
able to create the html table and display it, but the images where broken.

But looking around, I found the solution on the wikipedia:
http://en.wikipedia.org/wiki/Data_URI_scheme#Python_3

thanks everyone again.

Francesco




2013/9/12 Zoltán Vörös <zvoros@gmail.com>

>  But I have told you that there is an issue in python 3.3. I sent you a
> link in one of my earlier e-mails. In that link you should also find the
> fix.
>
> Cheers,
> Zoltán
>
>
> On 12/09/13 17:53, Francesco Montesano wrote:
>
> ehm.
> It does work with python 2. With python 3.3 I get in the notebook the
> symbols of brocken images and the string of the png printed in the console
>
>  Fra
>
>
> 2013/9/12 Francesco Montesano <franz.bergesund@gmail.com>
>
>> Dear Stefan,
>>
>>  Sorry for not replying before. It does work now.
>>
>>  Thanks,
>>
>>  Francesco
>>
>>
>>  2013/9/2 Francesco Montesano <franz.bergesund@gmail.com>
>>
>>>  Thanks,
>>>
>>>  I'll give a try tomorrow. not it's getting late
>>> Do you know if HTML understands b'...'?
>>>
>>>  Fra
>>>
>>>
>>>
>>>  2013/9/2 Stéfan van der Walt <stefan@sun.ac.za>
>>>
>>>> On Mon, Sep 2, 2013 at 10:31 PM, Francesco Montesano
>>>> <franz.bergesund@gmail.com> wrote:
>>>> > thank you very much for the example. This should work wonderfully for
>>>> python
>>>> > 2.x., but, as Zoltan pointed out, it won't work on python 3.x, as you
>>>> can't
>>>> > concatenate string and bytes objects (returned by base64 methods).
>>>>
>>>>  That shouldn't be too much of a problem:
>>>>
>>>> In [12]: bytes('asd'.encode('utf-8')) + base64.b64encode(b'asd')
>>>> Out[12]: b'asdYXNk'
>>>>
>>>> In [13]: (bytes('asd'.encode('utf-8')) +
>>>> base64.b64encode(b'asd')).decode('utf-8')
>>>> Out[13]: 'asdYXNk'
>>>>
>>>> Have a look at "numpy.compat" for some utility functions as well.
>>>>
>>>> Stéfan
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev@scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>
>>>
>>
>
>
> _______________________________________________
> IPython-dev mailing listIPython-dev@scipy.orghttp://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130913/01df5aff/attachment.html 


More information about the IPython-dev mailing list