Run pymol interactively from IPython notebook
import sys
import __main__
#__main__.pymol_argv = ['pymol', '-c'] # Optionnaly pass options to pymol
import pymol
stdout = sys.stdout # To get the stdout in the notebook instead of in the pymol console
import pymol.cmd as cmd
pymol.finish_launching()
sys.stdout = stdout
Example usage:
cmd.bg_color('white')
cmd.load('4ci0_A.pdb', object='native')
cmd.show_as('ribbon', 'native')
cmd.util.cbc() # Color By Chain
cmd.orient()