<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Seb,<br>
    <br>
    IDLE restarts the shell each time you run a script. This is the
    default behavior in order to have a clean interpreter. <br>
    <br>
    In terms of code design, you could try using "import YOURSCRIPT" in
    your other scripts and refer to path definitions. For example:<br>
    <br>
    YOURSCRIPT.py:<br>
    <br>
    &nbsp;&nbsp;&nbsp; path_to_files="/home/user/files/"<br>
    <br>
    <br>
    ANOTHERSCRIPT.py<br>
    <br>
    &nbsp;&nbsp;&nbsp; import YOURSCRIPT<br>
    &nbsp;&nbsp;&nbsp; print(YOURSCRIPT.path_to_files)<br>
    <br>
    <br>
    You can also modify the source code of IDLE itself. Look in
    ScriptBinding.py for "restart_shell". Commenting it out will disable
    shell restarts. (If you do this, then the only way to get a shell
    restart is to close the PyShell window and re-open it.) If you want
    to improve IDLE, you could submit a patch for making the shell
    restart an option on the Run menu. <br>
    <br>
    Alternatively, if you want to keep stateful information between
    script executions, try using the SubCode extension at
    <a class="moz-txt-link-freetext" href="http://idlex.sourceforge.net">http://idlex.sourceforge.net</a><br>
    and use the "Run All Subcodes" feature. This will run your script
    without restarting the shell.<br>
    <br>
    - Roger<br>
    <br>
    <br>
    <br>
    <br>
    On 11/21/2011 03:56 AM, Sebastien Beauvois wrote:
    <blockquote
cite="mid:39736C87C7695A4F859B19B67A5081D738A051EC1C@DEMAIL01.nvidia.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html;
        charset=us-ascii">
      <div>
        <p>Hi, </p>
        <p> &nbsp; </p>
        <p>I just installed the 2.7 Python version on my computer and I
          have a problem to run my scripts. It seems &#8220;Idle&#8221; makes a
          &#8220;restart&#8221; each time I run a new script in my shell and it
          occurs issues in my test execution because my first scripts
          contains all paths definition for other scripts. </p>
        <p> &nbsp; </p>
        <p>How can I remove the &#8220;Restart&#8221; in my shell (see pic
          attached)? </p>
        <p>I had a look in the option menu but I found nothing to solve
          it. </p>
        <p> &nbsp; </p>
        <p>Thank you in advance. </p>
        <p> &nbsp; </p>
        <p>Seb! </p>
        <p> &nbsp; </p>
      </div>
      <div> </div>
      <div>This email message is for the sole use of the intended
        recipient(s) and may contain confidential information.&nbsp; Any
        unauthorized review, use, disclosure or distribution is
        prohibited.&nbsp; If you are not the intended recipient, please
        contact the sender by reply email and destroy all copies of the
        original message. </div>
      <div> </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
IDLE-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:IDLE-dev@python.org">IDLE-dev@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/idle-dev">http://mail.python.org/mailman/listinfo/idle-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>