Coder Social home page Coder Social logo

have ipython integration about python.el HOT 4 CLOSED

fgallina avatar fgallina commented on August 17, 2024
have ipython integration

from python.el.

Comments (4)

fgallina avatar fgallina commented on August 17, 2024

aadis, the way shell integration is implemented should make it possible to integrate this mode with any text based python shell around.

An untested way to make ipython work would be something like this in your .emacs:

(setq python-shell-interpreter "ipython")
(setq python-shell-interpreter-args "")
(setq python-shell-prompt-regexp "In \\[[0-9]+\\]: ")
(setq python-shell-block-prompt-regexp "Out\\[[0-9]+\\]: ")
(setq python-shell-completion-setup-code "")
(setq python-shell-completion-strings-code "';'.join(__IP.complete('''%s'''))\n")

Probably you'll find quirks, feel free to open issues for it :)

from python.el.

fgallina avatar fgallina commented on August 17, 2024

aadis, I tested this and while it was working it was buggy.

Since commit aff95f77eba8801a2158b7d9f1a1f6af41d5755c you can make iPython work by adding this to your .emacs:

(setq
python-shell-interpreter "ipython"
python-shell-interpreter-args ""
python-shell-prompt-regexp "In [[0-9]+]: "
python-shell-prompt-output-regexp "Out[[0-9]+]: "
python-shell-completion-setup-code ""
python-shell-completion-string-code
"';'.join(__IP.complete('''%s'''))\n")

For me is working cool right now, give it a try and let me know.

from python.el.

aadis avatar aadis commented on August 17, 2024

Wow, fantastic. Works pretty well, all colors and what not too!

Though the tab completion in ipython is weird. It prints the name of the completion on a prompt and then prints the uncompleted text again on a new prompt.

I can provide more details if required.

But I'm pretty happy with the mode overall. Pretty clean. Thanks!

from python.el.

fgallina avatar fgallina commented on August 17, 2024

With the latest revision and these settings is working OK for me:
(setq
python-shell-interpreter "ipython"
python-shell-interpreter-args ""
python-shell-prompt-regexp "In [[0-9]+]: "
python-shell-prompt-output-regexp "Out[[0-9]+]: "
python-shell-completion-setup-code ""
python-shell-completion-string-code "';'.join(__IP.complete('''%s'''))\n")

If it's not for you, then you should fill a bug :)

Try running emacs like this:

emacs -Q --eval "(progn (add-to-list 'load-path "~/path/to/python-mode") (require 'python))"

That will run a clean emacs with just the changes introduced by this python-mode.

Give it a try, if you can provide some recipe to it, that would be awesome.

Thanks for your words,
Fabián.

from python.el.

Related Issues (20)

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.