Re: [PyMOL] Scripting attempts

2015-01-06 Thread Yarrow Madrona
Sorry, I didn't read the other entries. Thanks for the "python end" code. I have had this problem with loops a lot in pymol and this solves it. -Yarrow On Tue, Jan 6, 2015 at 9:21 AM, Yarrow Madrona wrote: > Hi Brenton, > > I'm pretty sure you have to import python in your script. Otherwise th

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Yarrow Madrona
Hi Brenton, I'm pretty sure you have to import python in your script. Otherwise the python commands will be ignored. Also you forgot to put colons after your 'for' statement. Either way, I think pymol got the first image then ignored the 'for statement' and just went straight to the second 'png...

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Matthew Baumgartner
I think that the problem is that python is interpreting part of your directories as special characters. This is due to the fact that Windows uses the backslash as the directory separator which is also a special character in python (and in *nix systems). In a regular python terminal, if I do:

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Tsjerk Wassenaar
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 wrote: > Be sure to reply to the list so everyone can benefit from the questions > and answers. > > Ah, as Tsjerk mentioned, you ne

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Matthew Baumgartner
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

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Matthew Baumgartner
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\

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Tsjerk Wassenaar
Hi :) You can use for-loops in pml files, but it's a bit tricky. Usually you will want to enclose the code in a python .. python end block, indicating that the lines are pure python: python for i in range(2,61): ... python end Also mind that range runs UP TO (excluding) the last number, so you

Re: [PyMOL] Scripting attempts

2015-01-06 Thread Matthew Baumgartner
Hi, You may need to use the API instead of the command. 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) Matt Baumgartner On 01/06/2015 10:01 AM, Brenton Horne wrote: > Hi > > I received this error from y

Re: [PyMOL] Scripting attempts

2015-01-06 Thread David Hall
(a) I'll let someone else say whether you can use range in pml files, not completely sure on that one and the formatting rules. personally, I would write this in python, and you would need a : after the range (b) you are missing any indication of what %4d refers to. See example 3.23 on http://www.