Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:53:08+00:00 2026-06-01T08:53:08+00:00

I like the python-send-buffer command, however I very often use Python embedded in applications,

  • 0

I like the python-send-buffer command, however I very often use Python embedded in applications, or launch Python via a custom package management system (to launch Python with certain dependencies).. In other words, I can’t just run “python” and get a useful Python instance (something that python-send-buffer relies on)

What I would like to achieve is:

  • in any Python interpreter (or application that allows you to evaluate Python code), import a magic_emacs_python_server.py module (appending to sys.path as necessary)
  • In emacs, run magic-emacs-python-send-buffer

This would evaluate the buffer in the remote Python instance.

Seems like it should be pretty simple – the Python module listens on a socket, in a thread. It evaluates in the main thread, and returns the repr() of the result (or maybe captures the stdout/stderr, or maybe both). The emacs module would just send text to the socket, waits for a string in response, and displays it in a buffer.

Sounds so simple something like this must exist already… IPython has ipy_vimserver, but this is the wrong way around. There is also swank, while it seems very Lisp-specific, there is a Javascript backend which looks very like what I want… but searching finds almost nothing, other than some vague (possibly true) claims that SLIME doesn’t work nicely with non-Lisp languages

In short:

  • Does a project exist to send code from an emacs buffer to an existing Python process?
  • If not, how would you recommend I write such a thing (not being very familiar with elisp) – SWANK? IPython’s server code? Simple TCP server from scratch?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:53:09+00:00Added an answer on June 1, 2026 at 8:53 am

    comint provides most of the infrastructure for stuff like this. There’s a bunch of good examples, like this or this

    It allows you to run a command, provides things comint-send-string to easily implement send-region type commands.

    dbr/remoterepl on Github is a crude proof-of-concept of what I described in the question.

    It lacks any kind of polish, but it mostly works – you import the replify.py module in the target interpreter, then evaluate the emacs-remote-repl.el after fixing the stupid hardcoded path to client.py

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to send many emails via Python and would like to connect to
I'm not sure if I like Python's dynamic-ness. It often results in me forgetting
I want to use some features of python like as Tuples and Sets in
I'd like to prevent multiple instances of the same long-running python command-line script from
In Python, I'm used to things like def send_command(command, modifier = None): and then
1) I would like to use the profiling functions in the Python C API
I have the following python script and I would like to send fake header
I use python based as well as rails applications on ubuntu linux. We have
I'd like to: Send request from the browser to a python CGI script This
How to send a raw http header in python just like header() in PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.