<html>
<head>
<!-- BaNnErBlUrFlE-HeAdEr-start -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
      .pfptBannerTableMSO { padding: 0px 12px 5px 12px; width: 100%;border-radius:4px;border-top:4px solid #90a4ae;background-color:#D0D8DC; }
      .pfptTitleMSO { color:#000000 !important;font-family: 'Arial', sans-serif !important;font-weight:bold !important;font-size:14px !important; }
      .pfptSubtitleMSO { font-size:12px !important; font-family: 'Arial', sans-serif !important; }
      .pfptButtonMSO { mso-padding-alt: 7.5px; padding: 7.5px; text-decoration: none; font-family: 'Arial', sans-serif !important; font-size: 14px; line-height: 40px; border-radius:2px; }
      .pfptPrimaryButtonMSO {
        border: 1.5px solid #666666; color: #000000;
      }
     .pfptBanner {
        margin: 15px 14px 30px 14px;
        padding: 8px 16px 8px 16px;
        border-radius: 4px;
        min-width: 200px;
        background-color: #D0D8DC;
        border-top: 4px solid #90a4ae;
      }
      .pfptBannerTitle {
        color: #000000;
        font-family: 'Arial', sans-serif;
        font-size: 14px;
        font-weight: bold;
        line-height: 18px;
        display: block;
      }
      .pfptBannerSubtitle {
        color: #000000;
        font-weight: normal;
        font-family: 'Arial', sans-serif;
        font-size: 12px;
        line-height: 18px;
        margin-top: 2px;
        display: block;
      }
      .pfptButton {
        display: inline-block;
        font-family: 'Arial', sans-serif;
        font-size: 14px;
        font-weight: normal;
        border-radius: 2px;
        padding: 7.5px 16px;
        margin: 3px 0 3px 16px;
        white-space: nowrap;
        width: fit-content;
      }
      .pfptPrimaryButton {
        border: 1px solid #666666;
      }
      .pfptPrimaryButton:hover, .pfptPrimaryButton:focus {
        background-color: #b4c1c7;
      }
      .pfptPrimaryButton:active {
        background-color: #90a4ae;
      }
      .pfptMessageContainer {
        display: inline-block;
        margin: 0px 0px 1px 0px;
        max-width: 600px;
      }
      .pfptButtonGroup {
        float: right;
        margin: 0px 0px 0px 16px;
        text-align: right;
        width: fit-content;
      }
      .pfptPreheader { display:none !important; visibility:hidden; mso-hide:all; font-size:1px; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; }
    </style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->


<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<span class="pfptPreheader" style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">
 Dear tony, Thanks for this very helpful tip ! it writes out the values into a separate csv file with the filenames and distance values. including the code below : _________________ import os from chimerax.core.commands import run as rc ‍ ‍ ‍ ‍
</span>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<span style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</span>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 3px 0px 16px 0px; direction: ltr" lang="en"><tr><td>
    <table class="pfptBannerTableMSO" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%;border-radius:4px;border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td><span class="pfptTitleMSO" style="color:#000000 !important;font-family: 'Arial', sans-serif;font-weight:bold !important;font-size:14px !important; direction: ltr">
          This Message Is From an External Sender
        </span></td></tr>
        <tr><td><span class="pfptSubtitleMSO" style="color:#000000 !important;font-weight:normal !important;font-family: 'Arial', sans-serif; font-size:12px !important; direction: ltr">
          This message came from outside your organization.
        </span></td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr" lang="en" class="pfptBanner" style="margin:16px 0px 16px 0px; padding:8px 16px 8px 16px; border-radius: 4px; min-width: 200px;background-color: #D0D8DC; border-top: 4px solid #90a4ae;">
    <div class="pfptMessageContainer" style="display: inline-block; margin: 0px 0px 1px 0px; max-width: 600px;">
      <div class="pfptBannerTitle" style="color:#000000 !important;font-family: 'Arial', sans-serif !important;font-weight:bold !important;font-size:14px !important;line-height:18px;display:block;">
        This Message Is From an External Sender
      </div>
      <div class="pfptBannerSubtitle" style="color:#000000 !important;font-weight:normal !important;font-family: 'Arial', sans-serif !important;font-size:12px !important;line-height:18px;margin-top:2px;display:block">
This message came from outside your organization.
      </div>

    </div>

  </div>
<![endif]>

<div style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->


<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Dear tony,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks for this very helpful tip ! it writes out the values into a separate csv file with the filenames and distance values. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
including the code below :</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
_________________</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
import os
<div>from chimerax.core.commands import run as rc</div>
<div><br>
</div>
<div><br>
</div>
<div>target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo'</div>
<div>os.chdir(target_folder)</div>
<div>home = os.getcwd()</div>
<div>xp_distance_file = os.path.join(home,'xp-distance-corrected.log')</div>
<div>xp_distance_obj = open(xp_distance_file, "w")</div>
<div><br>
</div>
<div>for f in os.listdir():</div>
<div>    if f.endswith('.mae'):</div>
<div>        print(f'working on {f}')</div>
<div>        rc(session, "open " + f)</div>
<div>        rc(session, "measure center #1.1 & ligand mark true")</div>
<div>        rc(session, "measure center #1.1 :310,335,728,759 mark true")</div>
<div>        # grab distance</div>
<div>        dist = rc(session, "distance #2 #3")</div>
<div>        rc(session, "close")</div>
<div>        xp_distance_obj.write(f"{f},{dist} \n")</div>
<div><br>
</div>
<div>xp_distance_obj.close()</div>
<div><br>
</div>
exit()<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
------------------</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
thanks once again for your review,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
amith</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Anthony James Schaefer <tony.schaefer@uga.edu><br>
<b>Sent:</b> Saturday, February 12, 2022 2:18 PM<br>
<b>To:</b> ChimeraX Users Help <ChimeraX-users@cgl.ucsf.edu>; Rangarajan, Amith <Amith.Rangarajan@ucsf.edu><br>
<b>Subject:</b> Re: python script for measuring distance</font>
<div> </div>
</div>
<style>
<!--
.x_pfptBannerTableMSO
        {padding:0px 12px 5px 12px;
        width:100%;
        border-radius:4px;
        border-top:4px solid #90a4ae;
        background-color:#D0D8DC}
.x_pfptTitleMSO
        {color:#000000!important;
        font-family:'Arial',sans-serif!important;
        font-weight:bold!important;
        font-size:14px!important}
.x_pfptSubtitleMSO
        {font-size:12px!important;
        font-family:'Arial',sans-serif!important}
.x_pfptButtonMSO
        {padding:7.5px;
        text-decoration:none;
        font-family:'Arial',sans-serif!important;
        font-size:14px;
        line-height:40px;
        border-radius:2px}
.x_pfptPrimaryButtonMSO
        {border:1.5px solid #666666;
        color:#000000}
.x_pfptBanner
        {margin:15px 14px 30px 14px;
        padding:8px 16px 8px 16px;
        border-radius:4px;
        min-width:200px;
        background-color:#D0D8DC;
        border-top:4px solid #90a4ae}
.x_pfptBannerTitle
        {color:#000000;
        font-family:'Arial',sans-serif;
        font-size:14px;
        font-weight:bold;
        line-height:18px;
        display:block}
.x_pfptBannerSubtitle
        {color:#000000;
        font-weight:normal;
        font-family:'Arial',sans-serif;
        font-size:12px;
        line-height:18px;
        margin-top:2px;
        display:block}
.x_pfptButton
        {display:inline-block;
        font-family:'Arial',sans-serif;
        font-size:14px;
        font-weight:normal;
        border-radius:2px;
        padding:7.5px 16px;
        margin:3px 0 3px 16px;
        white-space:nowrap;
        width:fit-content}
.x_pfptPrimaryButton
        {border:1px solid #666666}
.x_pfptMessageContainer
        {display:inline-block;
        margin:0px 0px 1px 0px;
        max-width:600px}
.x_pfptButtonGroup
        {float:right;
        margin:0px 0px 0px 16px;
        text-align:right;
        width:fit-content}
.x_pfptPreheader
        {display:none!important;
        visibility:hidden;
        font-size:1px;
        line-height:1px;
        max-height:0px;
        max-width:0px;
        opacity:0;
        overflow:hidden}
-->
</style><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr"><span class="x_pfptPreheader" style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">Amith, The "run" function can return a value depending on
 the command that is executed. For the distance command, the distance is returned as a floating-point number. If I'm understanding what you're trying to do, this should work
</span><span style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">ZjQcmQRYFpfptBannerStart</span>
<div dir="ltr" lang="en" class="x_pfptBanner" style="margin:16px 0px 16px 0px; padding:8px 16px 8px 16px; border-radius:4px; min-width:200px; background-color:#D0D8DC; border-top:4px solid #90a4ae">
<div class="x_pfptMessageContainer" style="display:inline-block; margin:0px 0px 1px 0px; max-width:600px">
<div class="x_pfptBannerTitle" style="color:#000000!important; font-family:'Arial',sans-serif!important; font-weight:bold!important; font-size:14px!important; line-height:18px; display:block">
This Message Is From an External Sender </div>
<div class="x_pfptBannerSubtitle" style="color:#000000!important; font-weight:normal!important; font-family:'Arial',sans-serif!important; font-size:12px!important; line-height:18px; margin-top:2px; display:block">
This message came from outside your organization. </div>
</div>
</div>
<div style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Amith,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The "run" function can return a value depending on the command that is executed. For the distance command, the distance is returned as a floating-point number. If I'm understanding what you're trying to do, this should work (I have not tested this):</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Consolas,Courier,monospace">import os</span>
<div><span style="font-family:Consolas,Courier,monospace">from chimerax.core.commands import run as rc</span></div>
<div><br>
</div>
<div><br>
</div>
<div><span style="font-family:Consolas,Courier,monospace">target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo'</span></div>
<div><span style="font-family:Consolas,Courier,monospace">os.chdir(target_folder)</span></div>
<div><span style="font-family:Consolas,Courier,monospace">home = os.getcwd()</span></div>
<div><span style="font-family:Consolas,Courier,monospace">xp_distance_file = os.path.join(home,'xp-distance.log')</span></div>
<div><span style="font-family:Consolas,Courier,monospace">xp_distance_obj = open(xp_distance_file, "w")</span></div>
<div><br>
</div>
<div><span style="font-family:Consolas,Courier,monospace">for f in os.listdir():</span></div>
<div><span style="font-family:Consolas,Courier,monospace">    if f.endswith('.mae'):</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        print(f'working on {f}')</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        rc(session, "open " + f)</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        rc(session, "measure center #1.1 & ligand mark true")</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        rc(session, "measure center #1.1 :310,335,728,759 mark true")</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        # grab distance<br>
</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        dist = rc(session, "distance #2 #3")</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        rc(session, "close")</span></div>
<div><span style="font-family:Consolas,Courier,monospace">        xp_distance_obj.write("%s    %.2f" % (f, dist))</span></div>
<div><br>
</div>
<div><span style="font-family:Consolas,Courier,monospace">xp_distance_obj.close()</span></div>
<div><br>
</div>
<span style="font-family:Consolas,Courier,monospace">exit()</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
Best,
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Tony<br>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Rangarajan, Amith via ChimeraX-users <chimerax-users@cgl.ucsf.edu><br>
<b>Sent:</b> Saturday, February 12, 2022 9:26 AM<br>
<b>To:</b> ChimeraX Users Help <ChimeraX-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [chimerax-users] python script for measuring distance</font>
<div> </div>
</div>
<style>
<!--
.x_x_pfptBannerTableMSO
        {padding:0px 12px 5px 12px;
        width:100%;
        border-radius:4px;
        border-top:4px solid #90a4ae;
        background-color:#D0D8DC}
.x_x_pfptTitleMSO
        {color:#000000!important;
        font-family:'Arial',sans-serif!important;
        font-weight:bold!important;
        font-size:14px!important}
.x_x_pfptSubtitleMSO
        {font-size:12px!important;
        font-family:'Arial',sans-serif!important}
.x_x_pfptButtonMSO
        {padding:7.5px;
        text-decoration:none;
        font-family:'Arial',sans-serif!important;
        font-size:14px;
        line-height:40px;
        border-radius:2px}
.x_x_pfptPrimaryButtonMSO
        {border:1.5px solid #666666;
        color:#000000}
.x_x_pfptBanner
        {margin:15px 14px 30px 14px;
        padding:8px 16px 8px 16px;
        border-radius:4px;
        min-width:200px;
        background-color:#D0D8DC;
        border-top:4px solid #90a4ae}
.x_x_pfptBannerTitle
        {color:#000000;
        font-family:'Arial',sans-serif;
        font-size:14px;
        font-weight:bold;
        line-height:18px;
        display:block}
.x_x_pfptBannerSubtitle
        {color:#000000;
        font-weight:normal;
        font-family:'Arial',sans-serif;
        font-size:12px;
        line-height:18px;
        margin-top:2px;
        display:block}
.x_x_pfptButton
        {display:inline-block;
        font-family:'Arial',sans-serif;
        font-size:14px;
        font-weight:normal;
        border-radius:2px;
        padding:7.5px 16px;
        margin:3px 0 3px 16px;
        white-space:nowrap;
        width:fit-content}
.x_x_pfptPrimaryButton
        {border:1px solid #666666}
.x_x_pfptMessageContainer
        {display:inline-block;
        margin:0px 0px 1px 0px;
        max-width:600px}
.x_x_pfptButtonGroup
        {float:right;
        margin:0px 0px 0px 16px;
        text-align:right;
        width:fit-content}
.x_x_pfptPreheader
        {display:none!important;
        visibility:hidden;
        font-size:1px;
        line-height:1px;
        max-height:0px;
        max-width:0px;
        opacity:0;
        overflow:hidden}
-->
</style><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr"><font color="BA0C2F">[EXTERNAL SENDER - PROCEED CAUTIOUSLY]</font><br>
<br>
<div><span class="x_x_pfptPreheader" style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">Hello everyone, Please see my script below: import os import sys
 from chimerax.core.commands import run as rc target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo' os.chdir(target_folder) home =os.getcwd() ž ž ž ž ž ž ž ž ž ž ž ž ž ž ž ž ž ž
</span><span style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">ZjQcmQRYFpfptBannerStart</span>
<div dir="ltr" lang="en" class="x_x_pfptBanner" style="margin:16px 0px 16px 0px; padding:8px 16px 8px 16px; border-radius:4px; min-width:200px; background-color:#D0D8DC; border-top:4px solid #90a4ae">
<div class="x_x_pfptMessageContainer" style="display:inline-block; margin:0px 0px 1px 0px; max-width:600px">
<div class="x_x_pfptBannerTitle" style="color:#000000!important; font-family:'Arial',sans-serif!important; font-weight:bold!important; font-size:14px!important; line-height:18px; display:block">
This Message Is From an External Sender </div>
<div class="x_x_pfptBannerSubtitle" style="color:#000000!important; font-weight:normal!important; font-family:'Arial',sans-serif!important; font-size:12px!important; line-height:18px; margin-top:2px; display:block">
This message came from outside your organization. </div>
</div>
</div>
<div style="display:none!important; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hello everyone,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Please see my script below:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
import os
<div>import sys</div>
<div>from chimerax.core.commands import run as rc</div>
<div>target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo'</div>
<div>os.chdir(target_folder)</div>
<div>home =os.getcwd()</div>
<div>all = os.listdir()</div>
<div>xp_distance_file = os.path.join(home,'xp-distance.log')</div>
<div>print_to_screen = sys.stdout</div>
<div>mae_files =[]</div>
<div>for f in all:</div>
<div>    if f.endswith('.mae'):</div>
<div>        mae_files.append(f)</div>
<div>        print(f'working on {f}')</div>
<div>        sys.stdout = open(xp_distance_file,'a')</div>
<div>        rc(session,"open " + f)</div>
<div>        rc(session,"measure center #1.1 & ligand mark true")</div>
<div>        rc(session,"measure center #1.1 :310,335,728,759 mark true")</div>
<div>        rc(session,"distance #2 #3")</div>
<div>        rc(session,"close")</div>
<div>        sys.stdout = print_to_screen</div>
<div>print(f'completed writing xp-distance values to {xp_distance_file} ; now moving to next loop')</div>
<div>for f in mae_files:</div>
<div>    line = f + '\n'</div>
<div>    open('file_list.txt','a').write(line)</div>
<div>print("loop is complete")</div>
exit()<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I am curently using stdout to write the distance values to a file .I am currently running it on command line</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
</div>
<img class="x_x_w-326 x_x_h-28" size="3867" style="margin:0px; max-width:100%; color:rgb(0,0,0)" data-outlook-trace="F:3|T:3" src="cid:68afa919-1a35-470f-808c-242e97c85957">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
 it seems like a round about way to do it. The output file has lot of special characters and it takes a bit of effort using regex to extract the values.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
 I think there might be some logger in chimerax which can do this or some other better way to write results to a file  , but i am not able to find it. </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
#############</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
please let me know your suggestions on improving this code.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
thanks,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
amith</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
</div>
</div>
</div>
</body>
</html>