Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In <code>python.el</code>, a new inferior process is launched in a new buffer if the <code>python-buffer</code> variable is set to <code>nil</code>. Therefore, it's possible to advise the <code>python-send-buffer</code> function to reset that variable to <code>nil</code> after every invocation, thereby forcing a new Python process to be executed for every subsequent <code>python-send-buffer</code> command. Something like the following should work:</p> <pre><code>(defadvice python-send-buffer (after python-send-buffer-new-proc activate) (setq python-buffer nil)) (ad-activate python-send-buffer) </code></pre> <p>I know that your post was asking for help with <code>python-mode.el</code>, but I thought it might be helpful to mention this anyway, as I'd surprised if <code>python-mode.el</code> doesn't use a similar mechanism. If I have time, I'll try to look into it.</p> <p>Edit: the <code>python-mode.el</code> package uses the command <code>py-shell</code> to initiate a new inferior Python process. I found <a href="http://mail.scipy.org/pipermail/ipython-user/2007-May/004365.html" rel="nofollow">a mailing list posting</a> in which a user provides an <em>ad hoc</em> function that appears to do what you need.</p> <p>By the way, it might be worth considering that trying to alter the default behavior of <code>python-mode</code> isn't the best approach to this problem. I don't know what your code does, and I'm not particularly familiar with Twisted, but it seems to me that experiencing major errors when evaluating your code a second time within the same session could be a sign of a more fundamental design problem. I fail to see how it could be a matter of multiple <code>imports</code> of the same module being the issue, as Python modules are only loaded once, with successive <code>import</code> statements having no effect (for that, an explicit <code>reload</code> or <code>execfile()</code> is required). If I'm completely off-base here, I apologize, but I felt this possibility might merit mention.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload