[chimerax-users] no gui mode and redirecting output of some commands

Shubham Devesh Ramgoolam sdramgoolam at uwaterloo.ca
Tue May 10 03:29:22 PDT 2022


Hi,
I hope you are doing well.
I have a python script (myscript.py) as follows:

from chimerax.core.commands import run
import os
os.chdir("C:\\Users\\Shubham\\Desktop")
run(session, "open C:\\Users\\Shubham\\Desktop\\PDB_Script\\1ebt.pdb")   # location of my pdb file
run(session, "sel aromatic & protein")
run(session, "log clear")
run (session, "info residue sel")
run(session, "log save aromatic_list.html")

I am using the following prompt for calling chimerax from command prompt:
Gui enabled:   chimerax --script C:\\Users\\Shubham\\Desktop\\myscript.py
Gui disabled:   chimerax --nogui --script C:\\Users\\Shubham\\Desktop\\myscript.py

With gui mode enabled, the html file, aromatic_list.html, is created.
However, when disabling gui, nothing is created.

I suspect this is because I am relying on the log which may not be functional when gui is disabled?
Is there a way of redirecting the output of certain commands (e.g info, distance, angle) to a desired text file when disabling gui?
I tried with sys.stdout but it did not work (empty text files were created.).

Regards,
Shubham

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20220510/52f0684a/attachment.html>


More information about the ChimeraX-users mailing list