Difference between revisions of "RPC"

From PyMOLWiki
Jump to navigation Jump to search
m (category)
(using proxied methods)
Line 16: Line 16:
 
srv.do('as cartoon')
 
srv.do('as cartoon')
 
srv.do('spectrum')
 
srv.do('spectrum')
 +
 +
# or
 +
srv.fetch('2xwu')
 +
srv.show_as('cartoon')
 +
srv.spectrum()
 
</source>
 
</source>
  

Revision as of 16:09, 3 March 2015

Remote control of PyMOL is possible with XML-RPC.

Launch PyMOL with the "-R" option to start the RPC server.

pymol -R

Connect from any client, using python:

import xmlrpclib
srv = xmlrpclib.Server('http://localhost:9123')

srv.do('fetch 2xwu')
srv.do('as cartoon')
srv.do('spectrum')

# or
srv.fetch('2xwu')
srv.show_as('cartoon')
srv.spectrum()

See Also