Hi Prathvi,
If you mean the script provided to runscript has two functions defined in it, and then calls one and then the other, then yes, absolutely.  If you mean that the script defines two functions, but that some runscript calls call one of the functions, and some call the other, then which function to call would somehow need to be indicated by the arguments to the runscript commands, but basically also yes.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Aug 26, 2023, at 8:33 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:

Just a follow-up query. Suppose I want to run two different python scripts using the "runscript" command. Is it possible that instead of declaring them in two separate python files, I create one python file, declare two separate functions and call them one after the another using the "runscript" command?

On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Prathvi,
I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute.  See the following help pages:

Chimera startup:
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html>

System command-line Chimera startup options:
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html>

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
>
> Hi,
>
> Is it possible to use python to execute commands on the command line of UCSF chimera without actually opening its GUI on the Windows platform?
>
> If not, then how to use python to open its GUI and execute the commands?
>
> I tried the "subprocess.Popen()" and "os.system()" methods to run its GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.



--
Prathvi Singh,
Research Fellow,
Department of Biological Sciences & Bioengineering,
Indian Institute of Technology, Kanpur-208016
_______________________________________________
Chimera-users mailing list -- chimera-users@cgl.ucsf.edu
To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/