Consider the following excerpt:

svg = drawer.GetDrawingText()
svg2 = svg.replace('svg:','')
svg3 = SVG(svg2)
print 'displaying svg:'
display(svg)
print 'displaying svg2:'
display(svg2)
print 'displaying svg3:'
display(svg3)

svg and svg2 display as xml text. svg3 displays as the image, in a Jupyter
notebook in Chrome.

On Mon, Oct 24, 2016 at 6:44 PM, Dimitri Maziuk <dmaz...@bmrb.wisc.edu>
wrote:

> On 10/24/2016 04:39 PM, Peter S. Shenkin wrote:
>
> > Or is it
> > rather because chemists in your target audience will be thinking of the
> > first atom in, say, a structure from an sd file as atom #1?
>
> That
>
> > 2. Regarding the last line, most of the RDKit code I've seen in past
> > examples displays the molecule using code like the following. When is it
> > necessary/not necessary to remove the "svg" string from the results of
> > GetDrawingText()?
>
> Not sure: it's a namespace, I'm assuming ipython can't deal with xml
> namespaces. Properly written programs should show it either way,
> unfortunately my target viewer is firefox (it's a web application and
> the user's default browser is firefox) and firefox isn't one of them.
> Without svg:'s it'll show the file as xml text instead of the image.
>
> HTH
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to