Emacs+Python(非默认模式)快速配置
2014-02-23 20:39
543 查看
Emacs自己带有Python模式,可以直接在Emacs内部运行Python,很方便。但是据说做得不是很好(来源:将Emacs作为Python集成开发环境 点击打开链接)。
上面这个是08年写的,比较老了。我试一下,顺便更新。其提供的下载链接现在也已经转移了。新的下载链接是:An Emacs mode for editing Python code 点击打开链接
下载之后,解压,cd进去
cd /home/rare/桌面/python-mode.el-6.1.3(这个改成你的路径)
chmod +x byte-compile-directory.sh
sudo ./byte-compile-directory.sh
这样编译完之后:
1.把python-mode.el-6.1.3放到主文件夹, 然后终端里输入
sudo cp -r ~/python-mode.el-6.1.3 /usr/share/emacs/site-lisp
2.打开.emacs,在文件尾部加入以下语句(原封不动拷过去):
(add-to-list 'load-path "/usr/share/emacs/site-lisp/python-mode.el-6.1.3")
(setq py-install-directory "/usr/share/emacs/site-lisp/python-mode.el-6.1.3")
(require 'python-mode)
3.重新打开Emacs,效果如下:
特别值得一提的是在Python菜单中,Interpreter比默认模式多了很多,各种Python版本都可以选择~~~
特别提醒,一定要编译过了才能做以上这几步
=================================附录==========================
另附一个把Emacs做成IDE的,回头再来研究: Emacs中打造强大的Python IDE 点击打开链接
我的.emacs配置文件(矩阵主题+Matlab+Python(非默认模式)):
上面这个是08年写的,比较老了。我试一下,顺便更新。其提供的下载链接现在也已经转移了。新的下载链接是:An Emacs mode for editing Python code 点击打开链接
下载之后,解压,cd进去
cd /home/rare/桌面/python-mode.el-6.1.3(这个改成你的路径)
chmod +x byte-compile-directory.sh
sudo ./byte-compile-directory.sh
这样编译完之后:
1.把python-mode.el-6.1.3放到主文件夹, 然后终端里输入
sudo cp -r ~/python-mode.el-6.1.3 /usr/share/emacs/site-lisp
2.打开.emacs,在文件尾部加入以下语句(原封不动拷过去):
(add-to-list 'load-path "/usr/share/emacs/site-lisp/python-mode.el-6.1.3")
(setq py-install-directory "/usr/share/emacs/site-lisp/python-mode.el-6.1.3")
(require 'python-mode)
3.重新打开Emacs,效果如下:
特别值得一提的是在Python菜单中,Interpreter比默认模式多了很多,各种Python版本都可以选择~~~
特别提醒,一定要编译过了才能做以上这几步
=================================附录==========================
另附一个把Emacs做成IDE的,回头再来研究: Emacs中打造强大的Python IDE 点击打开链接
我的.emacs配置文件(矩阵主题+Matlab+Python(非默认模式)):
(add-to-list 'load-path "~/.emacs.d/") (require 'color-theme) (color-theme-initialize) (color-theme-matrix) (add-to-list 'load-path "/usr/share/emacs/site-lisp/matlab-emacs") (load-library "matlab-load") (custom-set-variables '(matlab-shell-command-switches '("-nodesktop -nosplash"))) (add-to-list 'load-path "/usr/share/emacs/site-lisp/python-mode.el-6.1.3") (setq py-install-directory "/usr/share/emacs/site-lisp/python-mode.el-6.1.3") (require 'python-mode)
相关文章推荐
- [Python]快速解析数据库视图XML配置获取数据库字段说明
- 一、我的emacs配置--适用c/c++和python开发(https://github.com/pein0119/emacs.d)
- Emacs 设置 Python 编辑模式下的自动补全
- Hadoop默认模式、默认配置问题
- Emacs-095-sapcemacs快速打开自己的配置文件
- Sublime Text3配置python交互模式
- 修改Linux配置使其默认启动到命令行模式(控制台)
- Struts2 快速入门(hello struts2 简单示例,配置开发模式,导入struts源码,设置struts.xml源码提示)
- 快速部署Python应用:Nginx+uWSGI配置详解
- Emacs编辑器之Python与Perl的IDE环境配置
- 配置emacs的python开发环境
- 《Python 编程快速上手 — 让繁琐工作自动化》读书笔记之【第7章 模式匹配与正则表达式(2)】
- 快速部署Python应用:Nginx+uWSGI配置详解
- 快速部署Python应用:Nginx+uWSGI配置详解
- [转]快速部署Python应用:Nginx+uWSGI配置详解
- Emacs 配置 Python 编程环境
- Windows 配置Apache以便在浏览器中运行Python script的CGI模式
- Python快速学习01:Eclipse上配置PyDev & 'Hello World !'
- 快速部署Python应用:Nginx+uWSGI配置详解
- VIM 一键配置 只需要一条命令快速配置c++ python开发