Hey :)

"Image{}.png".format(str(i).zfill(4))

can also be written

Image{:04d}.png".format(i)

Cheers,

Tsjerk


On Tue, Jan 6, 2015 at 4:52 PM, Matthew Baumgartner <mp...@pitt.edu> wrote:

> Be sure to reply to the list so everyone can benefit from the questions
> and answers.
>
> Ah, as Tsjerk mentioned, you need to wrap it in a python-python end block.
>
>
> set ray_opaque_background, 0
>
> png C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> imatinib\PyMOL movie\Image0001.png, dpi=300, ray=1
>
> python
> for i in range(2,61):
>      cmd.rotate('y', 6)
>      cmd.png("C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> imatinib\PyMOL movie\Image{}.png".format(str(i).zfill(4)), dpi=300, ray=1)
> python end
>
>
> On 01/06/2015 10:40 AM, Brenton Horne wrote:
> > Sure is this is my code atm:
> >
> > set ray_opaque_background, 0
> >
> > png C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> > imatinib\PyMOL movie\Image0001.png, dpi=300, ray=1
> >
> > for i in range(2,61):
> >
> >     rotate y, 6
> >
> >     cmd.png("C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> > imatinib\PyMOL movie\Image{}.png".format(str(i).zfill(4)), dpi=300,
> > ray=1)
> >
> >
> > On 7/01/2015 1:33 AM, Matthew Baumgartner wrote:
> >> Is it in your for loop?
> >>
> >> for i in range(2,61):
> >>     rotate y, 6
> >>     cmd.png("C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> >> imatinib\PyMOL movie\Image{}.png".format(str(i).zfill(4)), dpi=300,
> >> ray=1)
> >>
> >> On 1/6/15, 10:13 AM, Brenton Horne wrote:
> >>> That gave the error:
> >>>
> >>> cmd.png("C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> >>> imatinib\PyMOL movie\Image{}.png".format(str(i).zfill(4)), dpi=300,
> >>> ray=1)
> >>> Traceback (most recent call last):
> >>>   File "C:\Python27\lib\site-packages\pymol\parser.py", line 464, in
> >>> parse
> >>>     exec(layer.com2+"\n",self.pymol_names,self.pymol_names)
> >>>   File "<string>", line 1, in <module>
> >>> NameError: name 'i' is not defined
> >>>
> >>> On 7/01/2015 1:03 AM, Matthew Baumgartner wrote:
> >>>> cmd.png("C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
> >>>> imatinib\PyMOL movie\Image{}.png".format(str(i).zfill(4)), dpi=300,
> >>>> ray=1)
> >>>
> >>
> >>
> >
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>



-- 
Tsjerk A. Wassenaar, Ph.D.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to