<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><font size="3" face="Arial" class="">Hi Tom,</font><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""> Chimera has a tool called ReadStdin which allows it to be run from a terminal and have commands typed into the terminal and output messages go to the terminal while the GUI shows the molecules or other data.</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/readstdin/readstdin.html" class="">https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/readstdin/readstdin.html</a></font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><span style="font-family: Arial; font-size: medium;" class="">But we have not added that tool to ChimeraX. </span><font size="3" face="Arial" class="">It seems like this is what you want for ChimeraX.</font></div><div class=""><span style="font-family: Arial; font-size: medium;" class=""><br class=""></span></div><div class=""><span style="font-family: Arial; font-size: medium;" class=""> There is a ChimeraX "remotecontrol" command</span></div><div class=""><span style="font-family: Arial; font-size: medium;" class=""><br class=""></span></div><div class=""><font face="Arial" size="3" class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://www.cgl.ucsf.edu/chimerax/docs/user/commands/remotecontrol.html" class="">https://www.cgl.ucsf.edu/chimerax/docs/user/commands/remotecontrol.html</a></font></div><div class=""><span style="font-family: Arial; font-size: medium;" class=""><br class=""></span></div><div class=""><span style="font-family: Arial; font-size: medium;" class="">that allows sending commands to ChimeraX using http for example, doing an http request via a browser or command-line program (wget / curl)</span></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://127.0.0.1:60958/run?command=open+1a0m" class="">http://127.0.0.1:60958/run?command=open+1a0m</a></font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class="">would run the command "open 1a0m". Probably emacs is not going to support that mechanism.</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""> As Eric mentioned your problem with the</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>IPython.terminal.embed.embed()</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class="">is it seems to run its own event loop. If you type exit to that terminal all of sudden the ChimeraX gui displays and works because IPython exits its event loop and ChimeraX gets its going. In fact I suspect that the above embed() call simply does not return until IPython is exit, and ChimeraX only starts its event loop after the script completes. I don't know how to remedy this.</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font size="3" face="Arial" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Tom</font></div><div class=""><font size="3" face="Arial" class=""><br class=""></font></div><div class=""><font face="-webkit-standard" size="3" class=""><br class=""></font><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 21, 2021, at 4:00 AM, Tom Mulvaney via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all,<br class=""><br class="">I'm wondering if anyone has any experience running ChimeraX with either a standard REPL or IPython REPL?<br class=""><br class="">ChimeraX already has a 'shell' tool that allows interacting with ChimeraX through a Python REPL which I've found invaluable for testing out ideas and poking around in ChimeraX in general.<br class=""><br class="">It would be really nice though if I could send Python code directly from my IDE to be evaluated. In order to make this work, it would be great if ChimeraX could be run from a terminal and provide a Python (or preferably IPython) REPL. As it stands, I've managed to nearly make this work with the following script:<br class=""><br class=""> import IPython.terminal.embed<br class=""> IPython.terminal.embed.embed()<br class=""><br class="">I then run:<br class=""><br class=""> ChimeraX --script repl.py<br class=""><br class="">After typing, `%gui qt5`, the ChimeraX GUI appears. <br class=""><br class="">I can then interact with the REPL directly from the comfort of Emacs and evaluate things - but! - the main 3D view does not end up being displayed.<br class=""><br class="">Does anyone know how to get the REPL and 3D stuff to work side-by-side?<br class=""><br class=""><br class="">Kind regards,<br class=""><br class="">Tom<br class=""><br class="">_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>