Skip to content

Instantly share code, notes, and snippets.

@davegreenwood
Created July 8, 2019 09:33
Show Gist options
  • Save davegreenwood/3faf034ae037c4d079630597a8d1d9d2 to your computer and use it in GitHub Desktop.
Save davegreenwood/3faf034ae037c4d079630597a8d1d9d2 to your computer and use it in GitHub Desktop.
vs code python snippets
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Code separation": {
"prefix": "sep",
"body":[
"# -----------------------------------------------------------------------------",
"# $1",
"# -----------------------------------------------------------------------------",
"$0"
],
"description": "Add a separation with a comment"
},
"Class and init":{
"prefix": "class",
"body":[
"class ${1:Name}(${2:object}):",
" \"\"\"$3\"\"\"",
" def __init__(self, ${4:params}):",
" super(${1:Name}, self).__init__()",
]
},
"Setup Simple":{
"prefix": "setup",
"body": [
"\"\"\"Basic setup.\"\"\"",
"from setuptools import setup",
"",
"",
"setup(name=\"$1\",",
" version=\"0.0.1\",",
" description=\"$2\",",
" author=\"Dave Greenwood\",",
" zip_safe=False,",
" py_modules=[\"$3\"],",
" )",
"$0"
],
"description": "Basic setup.py filler."
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment