From: Folmer F. <fo...@gm...> - 2011-02-17 08:12:08
|
Dear John 2011/2/17 John Russo <lam...@gm...>: > Hi, > I'm sorry for making such beginner's questions but searching the manual, > google > or the wiki didn't help me. > You're welcome to ask here. > I know how to extend pymol by writing python functions (through the > extend command). > But is it possible to do the opposite? I want to write a script that > loads a molecule, does something > to it and then displays the pymol window or outputs a png file. I want > to this without having to > enter commands in the pymol command line, since I need to put these > operations in a script, > without interactive control on pymol. > > Example. I want to write a script examply.py with which I can do > > ./examply.py mymolecule.xyz > > And for output I want to get mymolecule.png or the pymol window with all > the operations > already done. > I saw Tsjerks comment, ( and now yours since I write too slow) but was wondering maybe what you need is more simple. Do require to load PyMOL from a python script? If not, then simply put the commands you need into a text file with the .pml extension and PyMOL will recognize this when you run it. An example file (example.pml) load mymolecule.xyz zoom residue 45-60 png mymolecule.png Then do like this pymol -c example.pml And you get mymolecule.png Best regards, -- Folmer Fredslund |