Search: Language:
How to setup a complete IDE using python-mode.el was shown at EuroPython-2013 at Florence: https://ep2013.europython.eu/conference/p/andrea-crotti resp. http://www.youtube.com/watch?v=0cZ7szFuz18 Get the latest release from: * https://gitlab.com/python-mode-devs/python-mode The relevant page also has installation instructions. The following was enough for me, though: * Add python-mode.el to the LoadPath. * Add the following to your InitFile (autoload 'python-mode "python-mode" "Python Mode." t) (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) (add-to-list 'interpreter-mode-alist '("python" . python-mode)) Many distros add relevant autoloads e.g. Gentoo adds it to site-lisp/site-gentoo.el or possibly site-lisp/site-gentoo.d == Design == python-mode.el reduces number of needed keystrokes providing tailored commands. It makes edits faster, assists programming by speech, macro-driven input etc. Support Python language features, for example: py-up, py-down - travelling nested blocks Avoid typos fetching forms at point, a clause for example: py-backward-clause py-copy-clause py-down-clause ... No need to customize when testing different versions: py-execute-clause-python2 py-execute-clause-python3 py-execute-clause-ipython ... - Notion of finer grained parts - py-expression, py-minor-expression - Commands running versioned and paralleled (I)Python-executables, no need to re-define the default Python largely removing the need of an active region marked before, see py-execute-line and a whole bunch more Have a look at the menu. Directory "doc" lists commands. == some more commands === (defun py-next-block () "go to the next block. Cf. `forward-sexp' for lisp-mode" (interactive) (py-mark-block nil 't) (back-to-indentation)) ElDoc works with the python mode in GNU Emacs 22. (For Emacs 21, see the [http://www.loveshack.ukfsn.org/emacs/eldoc.el back-port] of Eldoc.) To enable it by default in your python mode buffers, you might want something like: (add-hook 'python-mode-hook '(lambda () (eldoc-mode 1)) t) 'py-help-at-point' can be used to get the internal python documentation on the function at point. For Emacs 23: C-c C-f "sys" -- this works, and describes the "sys" module in a separate Emacs help buffer. : If I define function "zoot", help doesn't on it -- it's only for global things. (Andreas Röhler: No: inside current buffer it jumps to definition, no need for a help buffer.) == Integrating python-mode's pdbtrack with xpdb and making it aware of generator expressions == AlexCoventry I have found the following settings helpful in using xpdb: {{{ ;; Let python-mode know about xpdb and generator expressions. (setq py-pdbtrack-input-prompt "\n[(<]*x?pdb[>)]+ " py-pdbtrack-stack-entry-regexp (concat "^> \\(.*\\)(\\([0-9]+\\))" "\\([?a-zA-Z0-9_]+\\|<genexpr>\\)()")) }}} xpdb is a fork of the standard library pdb, available here: https://code.launchpad.net/~eyal-lotem+launchpad/xpdb/main == other things you may be interested in === * Please report bugs and feature requests at https://bugs.launchpad.net/python-mode * Some rudimentary completion support is available from http://www.python.org/cgi-bin/moinmoin/EmacsPythonCompletion * use C-c ! to start ipython instead of python: http://ipython.scipy.org/ * press F1 to check your code with pylint: http://www.logilab.org/projects/pylint * Pretty good completion and refactoring support from: http://rope.sourceforge.net/ropemacs.html * Debugging within Emacs: PdbNotes * Another debugger, which contains Emacs interface: pydb (http://bashdb.sourceforge.net/pydb/). It even has multiple-windows interface :) * Python autocompletion using pycomplete: http://groups.google.com/group/comp.lang.python/msg/048168c675ff0c68 * More on completion: http://www.rwdev.eu/articles/emacspyeng * Yasnippet: http://code.google.com/p/yasnippet/ for Python, Django, django-templates snippets * Virtualenv: Using virtual environments within emacs: http://github.com/gabrielelanaro/emacs-starter-kit * Editing django templates : http://web-mode.org ---- ProgrammingModes PythonProgrammingInEmacs
Summary:
This change is a minor edit.
Please make sure you contribute only your own work. IP numbers are made available via the page history. If you want to keep it a secret, you need to use Tor. See TextFormattingRules for how to format text. See StyleGuide for the suggested writing style on this wiki.
To save this page you must answer this question:
What is the greatest editor out there?
Username:
Replace this text with a file