GithubHelp home page GithubHelp logo

python-snippets's Introduction

Python snippets

Python snippets collections.

Initially ported from PyCharm, TextMate, SublimeText and other editors/IDEs.

If you'd like to contribute, feel free to submit a pull request on github

Thanks!

Features

Base snippets

Abbreviation Description
env #!/usr/bin/env python
env3 #!/usr/bin/env python3
enc # -- coding=utf-8 --
enco # coding=utf-8
fenc from future import ...
fenco from future import ... (no -*-)
im import
fim from ... import ...
class New class
classd New dataclass
defs New method
def New function
adef Async function
property New property
enum New Enum
if if
for for
while while
try try:except:
tryef try:except:else:finally:
trye try:except:else:
tryf try:except:finally:
s self
__ magic
ifmain if name == "main"

Comprehensions

Abbreviation Description
lc List comprehension
lcie List comprehension if else
lci List comprehension if filter
dc Dictionary comprehension
dci Dictionary comprehension if filter
sc Set comprehension
sci Set Comprehension if filter
gc Generator comprehension
gci Generator comprehension if filter

Unittest

Abbreviation Description
ase Assert equal
asne Assert not equal
asr Assert raises
ast Assert True
asf Assert False
asi Assert is
asint Assert is not
asino Assert is None
asinno Assert is not None
asin Assert in
asni Assert not in
as Assert
fail Fail (a test)

Debugging

Abbreviation Description
pdb PDB set trace
ipdb iPDB set trace
rpdb rPDB set trace
pudb PuDB set trace

Tkinter

Abbreviation Description
imtk Import Tkinter py2
imtk3 Import tkinter py3
config Root configuration
button Button
label Label
frame Frame
entry Entry
grid Grid
sticky Sticky
checkbutton Check button
mainloop Main loop
pack Pack
side Side
bind Bind
menu Menu
addcascade Add cascade
addcommand Add command
addseperator Add seperator

Release Notes

See changelog for all changes and releases.

python-snippets's People

Contributors

cstrap avatar macintacos avatar andriyor avatar h3ct0rjs avatar sundhaug92 avatar lraphael avatar santosh avatar rksys avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.