1 Star 0 Fork 0

ii6uu99/vscode-python-snippets

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

VSCode Python

Note: This extension is still in development process. Some keyword may change.

This extension contains code snippets for Python for Visual Studio Code. Most of the shortcuts were selected from other more popular libraries.

Note: Main part of snippets.json was generated automaticaly base on https://github.com/honza/vim-snippets

Installation

To install this extension type Extensions in Command Pallete, then find a vscode-python-snippets extension.

Suported file types

  • Python (.py)

Snippets (WIP)

Abbreviation Description
env, #! #!/usr/bin/env python
env2, #!2 #!/usr/bin/env python2
env3, #!3 #!/usr/bin/env python3
enc # -- coding=utf-8 --
enco # coding=utf-8
im, imp import
fim, from from ... import ...
fdt from dataclasses import dataclass
cl, cls New class
cla New class with description
clai New class with description and init
claip New class with description, init and post_init
dtcl, dtcls New dataclass
dtcla New dataclass with description
dtclap New dataclass with description and post_init
df, def New function
dff, deff New method
sdf, sdef New static method
pr New property
prs New property and setter
if if
ife if/else
iff if/elif/else
el else
ei, eli elif
fr, for for
fre, fore for/else
wh, while while
dowh "do while" in loop
try try:except:
tryef try:except:else:finally:
trye try:except:else:
tryf try:except:finally:
. self
__ magic
ifmain if name == "main"
wth, with with
wta, wath with ... as ...

Todo

Extend a functionality base on other popular sets of snsippets

  1. https://github.com/cstrap/python-snippets

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
MIT License Copyright (c) 2020 Nex Sabre Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Contains the code snippets for Python (this snippets are base on honza\vin-snippets) 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ii6uu99/vscode-python-snippets.git
git@gitee.com:ii6uu99/vscode-python-snippets.git
ii6uu99
vscode-python-snippets
vscode-python-snippets
master

搜索帮助