python-mode

Emacs python-mode

懵懂的女人 提交于 2019-12-03 12:55:26
问题 I'm trying to configure Emacs23.2 to work with python2.7.3, using the package python-mode.el-6.0.7 After adding to my .emacs file these LISP lines, as indicated in the INSTALL instructions,... (add-to-list 'load-path "PATH/TO/PYTHON-MODE/") (setq py-install-directory "PATH/TO/PYTHON-MODE/") (require 'python-mode) ... I open a file foo.py and until here its all OK: python is recognised, the syntax is highlighted and emacs is working well. But I got the suspect I'm missing something or doing

Set python indent to 2 spaces in emacs 23?

雨燕双飞 提交于 2019-12-03 01:30:43
I am using emacs 23.1.1 on Ubuntu 10.04. I wish to program in Python with a 2-space indent. emacs looks to have a default mode for python (python.el?). I put the following in my .emacs: ;; Only spaces, no tabs (setq indent-tabs-mode nil) ;; Always end a file with a newline (setq require-final-newline nil) ;; Don't know which of these might work (setq-default tab-width 2) (setq-default python-indent 2) (setq-default py-indent-offset 2) When I edit a Python file, it uses a 4-space indent. When I try C-h v python-indent it says: python-indent's value is 4 Local in buffer webpage_cache.py; global

VIM: Use python3 interpreter in python-mode

我与影子孤独终老i 提交于 2019-12-02 19:39:42
I have recently switched to vim and configured it for Python-programming using this tutorial. Before, I have made sure that vim supports python3 (vim --version shows +python/dyn and +python3/dyn) using this article. But when executing a file from python-mode , still the python2.7 interpreter is chosen. How can I configure vim (or the python-mode) to run files on the python3 interpreter? My OS is Ubuntu 14.04 x64. Thanks in advance! Try adding this to your .vimrc file let g:pymode_python = 'python3' I found this in the help docs. In vim type: :help python-mode By default, vim is not compiled