Running Python Programs from Emacs
来源:互联网 发布:交换机有mac地址吗 编辑:程序博客网 时间:2024/06/05 16:15
http://www.bnikolic.co.uk/blog/python-running-emacs.html
Tips on running python from Emacs.
Setting-up
Python interpreter to use
If you have more than one version of python installed on your system you may want to tell emacs which one of those to use. The python interpreter that emacs will use is controlled by the py-python-command variable. You can set it with:
(setq py-python-command "/usr/local/bin/python2.3")
Associating files with python
Emacs will normally associate files ending with .py with python and enter python-mode if you open (visit) these files. You can associate other files with python through the use of the auto-mode-alist variable.
For example, scons is a popular build environment tool built on top of python. Its configuration files are in python themselves, so it is useful to be able to edit them in python-mode. This can be arranged by placing the following into your .emacs file:
(setq auto-mode-alist (cons '("SConstruct" . python-mode) auto-mode-alist))
Shell Environment
You can adjust the shell environment under which the python interpreter will run, including the content of thePYHTONPATH variable, using commands described in this entry.
Keystrokes
All of these work only in Python-mode, i.e., if you've open a file with a suffix .py.
- C-c ! to start a python interpreter as a sub-process, or if already started, to switch to this buffer.
- C-c C-c to send the entire current file to the interpreter
- C-M-x to send the current function definition the interpreter
- C-c ret to reload current file as python module
- Running Python Programs from Emacs
- Running shell commands from Emacs
- Running Programs Under GDB
- Compiling & Running HP C Programs
- Running Java3D Programs In Eclipse
- Compiling Programs from Source
- Before the Running of C/C++ Programs
- Excerpts from Writing Efficient Programs
- Calling C Programs from IDL
- Emacs+Python
- emacs 使用 - from dea
- From VS to Emacs
- Error while running application engine programs during installation
- the remote desktop connection,conldn\'t see the running programs
- Embedding Python in Your C Programs
- Python Simple Programs 简单小程序
- Start Your Windows Programs From An NT Service
- how to upload DSP programs from ARM to DSP
- 1011
- POJ 1384 完全背包
- Fibonacci Again
- 数据结构实验八——队列打印杨辉三角
- unity学习之NGUI(一)
- Running Python Programs from Emacs
- qplot()函数的详细用法
- 源码系列:红黑树
- 利用窗口分割将多EXE嵌入统一程序(MFC)
- Least Common Multiple
- I - DZY Loves Modification--行列单独操作+优先队列
- 安卓3.2后屏幕适配阶段性总结
- 非递归TrieTree
- android java-ril-jni-linux-c-c++