PyMOL>from pymol2 import PyMOL
PyMOL>lst = []
PyMOL>for i in range(0,3): lst.append( PyMOL() )
PyMOL>for pi in lst: print pi.__class__
pymol2.PyMOL
pymol2.PyMOL
pymol2.PyMOL
PyMOL>for pi in lst: pi.start()
PyMOL>load dat/helix_amber.pdb
 CmdLoad: "dat/helix_amber.pdb" loaded as "helix_amber".
PyMOL>lst[0].cmd.do("load dat/pept.pdb")
PyMOL>load dat/pept.pdb
 CmdLoad: "dat/pept.pdb" loaded as "pept".
PyMOL>lst[1].cmd.do("load dat/3al1.pdb")
PyMOL>load dat/3al1.pdb
HEADER    STRUCTURAL PROTEIN                      26-OCT-98   3AL1
TITLE     DESIGNED PEPTIDE ALPHA-1, RACEMIC P1BAR FORM
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: D, L-ALPHA-1;
COMPND   3 CHAIN: A, B;
COMPND   4 ENGINEERED: YES;
COMPND   5 OTHER_DETAILS: N TERMINI ARE ACETYLATED
 ObjectMolecule: Read secondary structure assignments.
 ObjectMolecule: Read crystal symmetry information.
 Symmetry: Found 2 symmetry operators.
 CmdLoad: "dat/3al1.pdb" loaded as "3al1".
PyMOL>lst[2].cmd.do("load dat/1tii.pdb")
PyMOL>load dat/1tii.pdb
HEADER    ENTEROTOXIN                             20-MAR-96   1TII
TITLE     ESCHERICHIA COLI HEAT LABILE ENTEROTOXIN TYPE IIB
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: HEAT LABILE ENTEROTOXIN TYPE IIB;
COMPND   3 CHAIN: D, E, F, G, H, A, C;
COMPND   4 SYNONYM: LT-IIB;
COMPND   5 ENGINEERED: YES;
COMPND   6 OTHER_DETAILS: LATENT/INACTIVE FORM
 ObjectMolecule: Read secondary structure assignments.
 ObjectMolecule: Read crystal symmetry information.
 Symmetry: Found 6 symmetry operators.
 CmdLoad: "dat/1tii.pdb" loaded as "1tii".
PyMOL>python
    1:open("tmp/M0041a.pml",'w').write('''
    2:
    3:print __script__
    4:count_atoms
    5:
    6:''')
PyMOL>python end
PyMOL>@tmp/M0041a.pml
PyMOL>print __script__
tmp/M0041a.pml
PyMOL>count_atoms
 count_atoms: 392 atoms
PyMOL>lst[0].cmd.do("@tmp/M0041a.pml")
PyMOL>@tmp/M0041a.pml
PyMOL>print __script__
tmp/M0041a.pml
PyMOL>count_atoms
 count_atoms: 107 atoms
PyMOL>lst[1].cmd.do("@tmp/M0041a.pml")
PyMOL>@tmp/M0041a.pml
PyMOL>print __script__
tmp/M0041a.pml
PyMOL>count_atoms
 count_atoms: 679 atoms
PyMOL>lst[2].cmd.do("@tmp/M0041a.pml")
PyMOL>@tmp/M0041a.pml
PyMOL>print __script__
tmp/M0041a.pml
PyMOL>count_atoms
 count_atoms: 5684 atoms
PyMOL>for pi in lst: pi.stop()
PyMOL>del lst
