How to open IPython interpreter in emacs?

前端 未结 6 1792
名媛妹妹
名媛妹妹 2020-12-04 20:17

In order to use IPython during Python development in Emacs, I have been opening up a terminal, and typing ipython. This doesn\'t seem like the right way to do i

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 20:42

    UPD Detailed instructions for beginners:

    1. Copy this:

      (defun ipython ()
          (interactive)
          (term "/usr/bin/ipython"))
      
    2. Try first launching Emacs as emacs -q from the terminal. -q means don't load any customized code. It means that in this mode your emacs will behave exactly like mine.

    3. You should now be at the welcome screen. Press q.
    4. You should now be in the *scratch* buffer. Press C-y to paste the code you copied from the browser.
    5. Position your cursor at the very end of the code, right after the last parenthesis.
    6. Press C-j to evaluate the code. The name ipython pops up.
    7. Now you can execute this command as any other e.g. M-x ipython.
    8. If you want this change to become permanent, append the code to your ~/.emacs.

提交回复
热议问题