Coder Social home page Coder Social logo

emacs-python's Introduction

Emacs-Python: a Python module for Emacs

Emacs-Python is a very lightweight bridge between Emacs 25 and Python. It provides an Emacs extension module that runs the Python interpreter inside Emacs, so that Python functions can be run transparently from within Emacs.

Requirements

Emacs-Python requires a recent build of Emacs (>= 25.1) with module support enabled. Most likely, this will involve compiling Emacs from source with the --with-modules flag.

Emacs-Python also requires Python (2.7; Python 3 support is in the works).

Building

To build, run make. If there are no errors, you should have a file emacs-python.so in the src/ folder.

If you want to build against a non-standard Python interpreter, make sure that the python-config script refers to that interpreter before building (by editing the Makefile if necessary).

Walkthough

To use, copy the emacs-python.so library to a directory that's on the Emacs load-path.

From within Emacs, run

(require 'emacs-python)

To send a Python snippet to the embedded interpreter, use python-exec:

(python-exec "
def foo():
   return 42
")

To call a Python function from within Emacs, use python-funcall:

(python-funcall "foo") ;; outputs 42

(python-funcall "range" 3 7) ;; outputs (3 4 5 6)

The return value of Python function calls will be serialized into an equivalent Emacs type. If there's no meaningful corresponding return type, Emacs will return a user-ptr.

License

Emacs-Python is released under the GPL, version 3.0.

emacs-python's People

Contributors

jvkersch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.