Jerome, Try calling
pymol.cmd.refresh() before pymol.cmd.png(name) Cheers, Warren -- Warren L. DeLano, Ph.D. Principal Scientist . DeLano Scientific LLC . 400 Oyster Point Blvd., Suite 213 . South San Francisco, CA 94080 USA . Biz:(650)-872-0942 Tech:(650)-872-0834 . Fax:(650)-872-0273 Cell:(650)-346-1154 . mailto:war...@delsci.com > -----Original Message----- > From: pymol-users-ad...@lists.sourceforge.net > [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of > Jerome PANSANEL > Sent: Friday, January 06, 2006 5:06 AM > To: pymol-users@lists.sourceforge.net > Subject: [PyMOL] Python scripting for Pymol > > Hi, > > I writing a small script in python, in order to export png > picture from a MDL sdfile. > Here is a sample of the function : > > def mol2png(ctfile,name): > pymol.cmd.read_molstr(ctfile,name) > pymol.cmd.set("valence",1) > pymol.cmd.color("black","elem c") > pymol.cmd.color("red","elem o") > pymol.cmd.color("blue","elem n") > pymol.cmd.color("yellow","elem s") > pymol.cmd.bg_color("white") > pymol.cmd.zoom(name) > pymol.cmd.png(name) > time.sleep( 1 ) > pymol.cmd.delete(name) > > > It works fine only if I have the function time.sleep(1). If > not, I have only empty pictures. Is there another solution to > delete the molecule only when the png file has been written ? > > Thanks, > > Jerome Pansanel > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files for problems? Stop! Download the new AJAX > search engine that makes searching your log files as easy as > surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users > > > >