Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 958 Bytes

readme.md

File metadata and controls

30 lines (16 loc) · 958 Bytes

This is a selection of Python snippets and commands I used to use in Textmate that I missed when I moved to sublime.

Snippet list

[]: List comprehension and List comprehension with If statement

(): Tuple comprehension

{}: Dictionary comprehension

ternary: Gives a ternary operator

try: Python3 try-catch statements

with: With context block, defaults to opening a file so handy way to remember how to do that

fordict: For loop using dictionary.items() as the iterator

else: Adds a colon and new line, it's just something I miss from my Textmate bundle

re: A selection of common regex commands

query: A pair of database query shortcuts using a cursor

excep: Shortcut to - raise Exception("")

exceptions: A list of exception types

magic: A selection of magic functions. The most common are each a separate snippet while the less common are lumped together as one list per category.