Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python Templates for the PyCharm IDE
Python
branch: master

Merge pull request #5 from tiborsimon/patch-1

class - w/out docstring, classd w/ docstring
latest commit 2a389bdab4
Peter Hoffmann authored
Failed to load latest commit information.
README.md Update README.md
export.py Merge branch 'luw2007'
user.xml class - w/out docstring, classd w/ docstring

README.md

About

PyCharm lets you define live templates that expand a word into a snippet of code with some input fields. They work similar to textmate snippets and snipmate for vim.

You can either add your on snippets via File/Settings/Live Templates or select a region and add the text with Tools/Save as Live Template.

Live templates are stored in the following location:

Windows: <your home directory>\.<productname><versionnumber>\config\templates
Linux: ~\.<product name><version number>\config\templates
MacOS: ~/Library/Preferences/<product name><version number>/templates

Example

MacOS, PyCharm 3

git clone git@github.com:hoffmann/PyCharm-Python-Templates.git
cp PyCharm-Python-Templates/user.xml ~/Library/Preferences/PyCharm30/templates/

You could also copy/paste the template XML to the Python.xml file but that's more work.

If you have not defined any user templates yet, you can copy the user.xml to the templates location, otherwise you have to merge the files or add the templates by hand.

See http://peter-hoffmann.com/2010/python-live-templates-for-pycharm.html for more information.

How to use

Now you should be able to type "fnpdoc<TAB>", meaning you type the letters "fnpdoc" and then press the button <TAB> and it will fill the live template, in this case with the numpy docstring template for a function. Visually,

fnpdoc<TAB>

will become:

Parameters
----------


Returns
-------


Raises
------
Something went wrong with that request. Please try again.