How do I run a python interpreter in Emacs?

后端 未结 8 566
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 15:59

I just downloaded GNU emacs23.4, and I already have python3.2 installed in Windows7.

I have been using Python IDLE to edit python files.

The problem is that I ca

相关标签:
8条回答
  • 2021-02-01 16:14

    You probably need to have Python in your windows PATH environment variable. Can you start the interpreter just by typing python in the command window?

    I don't have anything special in my emacs.el, but the start interpreter command works just fine.

    Also, I recommend reading this blog post, as it contains many useful tips and packages worth installing if using Emacs as a Python IDE.

    0 讨论(0)
  • 2021-02-01 16:24

    IF you have python installed, try M-x python-shell (press and hold ALT while pressing x, then type python-shell, then press enter)

    There are different language implementations if that is what you are asking (see a list of them here).

    0 讨论(0)
  • 2021-02-01 16:27

    To simply open an interpreter, you can also use M-x python. If that does not work, try M-x python and hit TAB, which will list more options via auto-completion. One of them should work k if you have python installed.

    If you are inclined, it may be worthwhile to check out the Emacs python modes as well - http://www.emacswiki.org/emacs/?action=browse;oldid=PythonMode;id=PythonProgrammingInEmacs

    0 讨论(0)
  • 2021-02-01 16:31

    In emacs 25.3.1 I use this to open up a python shell:

    M-x run-python
    

    After first adding this to my .emacs file:

    (setq python-shell-interpreter "/usr/local/bin/python3")
    
    0 讨论(0)
  • 2021-02-01 16:33

    Place this in your .emacs to let emacs know where is your python interpretor

     (setq python-shell-interpreter "path\to\your\python3.2")
    

    To learn about.emacs you can read about it in Emacs itself.(Emacs comes with good info manuals and info mode to help to read that manual).

    press the following in emacs

    M-: (info "(Emacs)Init file") RET.

    0 讨论(0)
  • 2021-02-01 16:34

    In emacs 24.2 there is python-switch-to-python

    0 讨论(0)
提交回复
热议问题