Launching From a Script: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:


<source lang="python">
<source lang="python">
#!/usr/bin/env python
#!/usr/bin/env python
   
   
# Tell PyMOL we don't want any GUI features.
# Tell PyMOL we don't want any GUI features.
import __main__
import __main__
__main__.pymol_argv = [ 'pymol', '-Gi' ]
__main__.pymol_argv = [ 'pymol', '-Gi' ]
   
   
# Importing the PyMOL module will create the window.
# Importing the PyMOL module will create the window.
   
   
import pymol
import pymol
   
   
# Call the function below before using any PyMOL modules.
# Call the function below before using any PyMOL modules.
   
   
pymol.finish_launching()
pymol.finish_launching()
   
   
from pymol import cmd
from pymol import cmd
cmd.stereo('walleye')
cmd.stereo('walleye')
cmd.set('stereo_shift', 0.23)
cmd.set('stereo_shift', 0.23)
cmd.set('stereo_angle', 1.0)
cmd.set('stereo_angle', 1.0)
</source>
</source>

Revision as of 13:01, 9 June 2005

You can also script your launch. Here is an example script that launches PyMol for stereo viewing on a VisBox. It runs PyMol fullscreen stereo, and disables the internal gui.

#!/usr/bin/env python
 
# Tell PyMOL we don't want any GUI features.
import __main__
__main__.pymol_argv = [ 'pymol', '-Gi' ]
 
# Importing the PyMOL module will create the window.
 
import pymol
 
# Call the function below before using any PyMOL modules.
 
pymol.finish_launching()
 
from pymol import cmd
cmd.stereo('walleye')
cmd.set('stereo_shift', 0.23)
cmd.set('stereo_angle', 1.0)