python script running OUTSIDE chimera possible?

hello chimera experts, as far as i know, python scripting for chimera is done within the context of chimera like chimera --nogui myscript.py parameters ... is it possible to run myscript.py without the need of the chimera executable and use import statements of some sort to access the chimera module(s) like python myscript.py parameters best regards, fred

Hello Fred, In some cases, it is possible to do what you want, but in general it is not possible because Chimera has its own versions of system libraries that it needs to work correctly -- so it depends on how different Chimera's version of the libraries are from the system ones, and that changes from release to release of Chimera and which system Chimera is installed on. So you are much better off using 'chimera --nogui --silent --script ...', or starting up chimera and opening the .py file. In the Chimera Programmer's FAQ, http://www.cgl.ucsf.edu/chimera/current/docs/ProgrammersGuide/faq.html <http://www.cgl.ucsf.edu/chimera/current/docs/ProgrammersGuide/faq.html#q3> there is a section on how to pass arguments to scripts that shows how to encapsulate 'chimera --nogui --silent --script' in a Linux/Mac OS X shell script. I will add a section to the Programmer's FAQ about how to install other Python packages into chimera. And if you still would still like the gory details, look at the chimera startup script and how it manipulates environment variables. There is some additional (some redundant) environment manipulation in CHIMERA/share/__main__.py, and then, unlike __main__.py, you would call chimeraInit.init([], eventloop=False) before invoking any chimera packages. HTH, Greg On 04/17/2013 04:08 PM, frederick lee wrote:
hello chimera experts, as far as i know, python scripting for chimera is done within the context of chimera like
chimera --nogui myscript.py parameters ...
is it possible to run myscript.py without the need of the chimera executable and use import statements of some sort to access the chimera module(s) like
python myscript.py parameters best regards, fred
participants (2)
-
frederick lee
-
Greg Couch