In this section are described the most useful emacs-for-python snippets (using the Yasnippet extension). It is possible that for the same keyword there are two available snippets, you will prompted by yasnippet when using it.
If you write some awesome and useful snippet, tell me and I will include in emacs-for-python!
This is used to document the code you're using, it insert the triple quotes:
"""_ """
note that if you're using cua-mode you can select a region, then type doc and the region will be wrapped with triple quotes!
Insert the class snippet, reduced to bare-bones:
class ClassName(Base): _
Insert the constructor method of the class:
def __init__(self, ...): _
Automatically call the super method in this way:
class MyFrame(wx.Frame) def __init__(self, name = "MyName"): <TAB>
produces:
class MyFrame(wx.Frame) def __init__(self, name = "MyName"): super(MyFrame, self).__init__(name="MyName)_
unittest.TestCase
class used for unittests
Used at the end of file in executable scripts, I use it all the time:
if __name__ == '__main__': _
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4