You can do input arguments to your script.

#!/usr/bin/env python
import sys, os
try: pathtoscripts = sys.argv[1]
except: pathtoscripts = ""

Then: /my/dir/home

Or else i would try to make a script, and import pymol as module.
I dont really know how to do this.

Troels Emtekær Linnet

2012/5/8 Rituparna Sengupta <>

I'm wondering if anyone could tell me if there is a way of running a plugin in batch mode. I tried running it as a script but does not work when I use pymol -c or pymol -cq. The script has multiple arguments in the form of a list. I assign the variables to a list and then use that list to run the script. It works when the GUI is open (because I can assign values to a variable), but doesn't when I use -c or -cq (can't assign values from the command line.

File name:

I used the extend command to extend the plugin to the command line (as described in the plugin tutorial). The end of the file has something like this:

def dosomething(app):

 'Enter variable: ',
 'Enter variable: ',

 'Enter variable: ',
 info=[a, b, c]

cmd.extend('do_Something', do_Something)

When the GUI is open, I assign the values of a, b and c to a variable string like: inf=['a', 'b', c]; by typing into the pymol command line. Then I can run the plugin using: do_Something(inf)
But I can't assign the values of a, b, and c to inf when using batch mode. I don't know how to. If anybody has any suggestions, please let me know. I'll be grateful for any advice.
Thanks in advance


Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
PyMOL-users mailing list (
Info Page: