<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Ahir,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>I think the issue is that in nogui mode, print statements and status messages go to “standard output” and on Window standard output is, um, well — I don’t really know what it is on Windows. I think the simplest solution is to send your print/status statements to a file and monitor that file to check on progress. So near the top of the file do something like this:</div><div class=""><br class=""></div><div class="">outf = open(“C:/my-home-folder/output.txt”, “w”)</div><div class=""><br class=""></div><div class="">and change <i class="">print “x”</i> and <i class="">replyobj.status(“x”)</i> to:</div><div class=""><br class=""></div><div class="">print>>outf, “x”</div><div class=""><br class=""></div><div class="">you may need to do <i class="">outf.flush()</i> to get the print statements into the file immediately (otherwise they may be buffered up to be written later).</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>UCSF Computer Graphics Lab</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Nov 27, 2018, at 8:03 AM, Ahir Pushpanath <<a href="mailto:ahir29@gmail.com" class="">ahir29@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Dear Chimera crew, <div class=""> I am having serious trouble running my script using chimera --nogui --script option. I tried running a simple script that just prints a comment, and i dont get anything returned on the cmd, let alone the actual script. </div><div class=""><br class=""></div><div class="">The cmd does not flag up any errors , it just does nothing and return back to the prompt.</div><div class="">I have chimera 1.13.1 and its added to the system path - "C:\Program Files\Chimera 1.13.1rc\bin\". I can launch chimera fine from the command line showing its added to path fine.</div><div class=""><br class=""></div><div class="">I am completely stumped! Also, the script works fine within the IDLE of the GUI.</div><div class=""><br class=""></div><div class="">See code below:</div><div class=""><br class=""></div><div class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">import os<br class="">print "Script is running"<br class="">from chimera import runCommand as rc # use 'rc' as shorthand for runCommand<br class="">from chimera import replyobj # for emitting status messages<br class=""># change to folder with data files<br class="">os.chdir("C:/Users/JM/Documents/Public Qsync/Jenny Taylor/IREDs/Structures/")<br class=""># gather the names of .pdb files in the folder<br class="">file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]<br class=""># loop through the files, opening, processing, and closing each in turn<br class="">for fn in file_names:<br class=""> res = "tyr"<br class=""> if fn == ""2NAD.pdb":<br class=""> print fn<br class=""> replyobj.status("Processing " + fn) # show what file we're working on<br class=""> rc("open " + fn)<br class=""> for b in range(1,300):<br class=""> rc("sel #0" + ":"+str(b))<br class=""> rc ("swapaa "+res + " sel criteria p")<br class=""> rc ('write format pdb #0'+ " " + fn +"_"+res+'mutated.pdb')<br class=""> rc("close all")<br class=""># uncommenting the line below will cause Chimera to exit when the script is done<br class="">rc("stop now")</blockquote></div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class="">Dr. Ahir Pushpanath<b class=""> PhD.</b><br class="">Senior Biologist,<br class=""></div>Johnson Matthey.<br class=""><div class=""><div class=""><br class=""><br class=""></div></div></div></div></div></div></div></div>
_______________________________________________<br class="">Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">Manage subscription: <a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class=""></div></blockquote></div><br class=""></div></body></html>