emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: George Moutsopoulos <gmoutso@yahoo.co.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org babel python execute from local buffer to remote session [9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)]
Date: Sun, 28 Aug 2022 12:13:36 +0800	[thread overview]
Message-ID: <87ler9uhsf.fsf@localhost> (raw)
In-Reply-To: <CABU1Ay-kU+SkJ2iCu-00XhSmtk7PahsMFM_uWknnx7tW-fLD6A@mail.gmail.com>

George Moutsopoulos <gmoutso@yahoo.co.uk> writes:

> Hi all. I often need to run some code on a remote ssh session, because
> only there I can access a database and the environment is hard to
> replicate, while I want to keep the code I run on my local machine.
>
> The remote session is initialised with run-python after I change
> default-directory and use pythonic-activate. Sending commands from a
> local python buffer using python.el works without issues. It would be nice
> if I can do
> the same from a local org-mode buffer from a python source block.

Could you please elaborate how you change the default-directory?
The canonical way to tell Org babel which directory to use is :dir
header argument. AFAIK, python process and files should all be created
in the right context then.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


      parent reply	other threads:[~2022-08-28  4:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABU1Ay-kU+SkJ2iCu-00XhSmtk7PahsMFM_uWknnx7tW-fLD6A.ref@mail.gmail.com>
2022-08-26  8:58 ` [BUG] org babel python execute from local buffer to remote session [9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)] George Moutsopoulos
2022-08-27  3:05   ` Tim Cross
2022-08-28  4:13   ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ler9uhsf.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gmoutso@yahoo.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).