<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 8, 2011, at 12:45 AM, Damien Larivière wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <div bgcolor="#FFFFFF" text="#000000"> Dear all,<br> <br> Within a loop for i in range(1, 5), I would like to save the Reply Log in text file in a specific location.<br> <br> My script fails when I use such syntax, saying Unrecognized command:<br> <br> <b>from chimera.tkgui import saveReplyLog<br> rc("saveReplyLog('C:\Program Files (x86)\Hex 6.3\examples\replyLog%d.txt')" % i)</b><br> <br> I looked at old posts saying the syntax to be saveReplyLog('path') but it does not work.<br> <br> May you tell me what is wrong with it? I can post the whole script if necessary.</div></blockquote><br></div><div>Hi Damien,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>'saveReplyLog' is a Python function, not a Chimera command. Therefore, it should be used directly rather than inside an rc() call. So, like this:</div><div><br></div><div>from chimera.tkgui import saveReplyLog</div><div bgcolor="#FFFFFF" text="#000000">saveReplyLog(r'C:\Program Files (x86)\Hex 6.3\examples\replyLog%d.txt' % i)</div><div bgcolor="#FFFFFF" text="#000000"><br></div><div bgcolor="#FFFFFF" text="#000000">Note the 'r' in front of the 'C:\Program Files\...' string. This tells Python not to treat the backslashes in the string specially (i.e. treat it as a "raw" string). Otherwise you would need to use two backslashes in a row every place you wanted one.</div><div bgcolor="#FFFFFF" text="#000000"><br></div><div bgcolor="#FFFFFF" text="#000000">--Eric</div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></div></span> </div><br></body></html>