Is there a method to set what buffer python-mode
looks to for a running python process?
I have a babel block in org-mode like
#+BEGIN_SRC python :session session1
import os
os.uname()
#+END_SRC
I can run the block (C-cC-c). I get results and a new *session1*
buffer.
But I want to tinker with the code in the block. So I open it in a new buffer with the cord C-C C-' and am in org-src-mode ("OrgSrc") and python major mode (C-h b shows, for example, bindings for python-shell-send-region
). However, attempting to use these bindings instead throws the warning:
Start a python process first with 'M-x run-python' or 'C-c C-p'.
Python is running, but it's in *session1*
. If I do not name the :session
the buffer is *Python*
and all works as expected.
And, if i follow the run-python suggestion, a new *Python*
buffer is created which is obviously not the same session in which the first execution occurred.
In addition to potentially having a need for separate sessions on a single host, I am tinkering with this simplified example in an effort to have a more usable python mode when interacting with tramp/:dir
. e.g.
#+BEGIN_SRC python :session :dir /HostB:/tmp/
import os
os.uname()
#+END_SRC
I've also tried ob-ipython
but I'm not sure configuring it to work with remote hosts is feasible.