VS Code Extensions / Shortcuts For Python / Web - DEV Community

Forem Logo DEV Community Logo DEV Community Main Image

DEV Community

Follow

A space to discuss and keep up software development and manage your software career

Future Logo Future Main Image

Future

Follow

News and discussion of science and technology such as AI, VR, cryptocurrency, quantum computing, and more.

Open Forem Logo Open Forem Main Image

Open Forem

Follow

A general discussion space for the Forem community. If it doesn't have a home elsewhere, it belongs here

Gamers Forem Logo Gamers Forem Main Image

Gamers Forem

Follow

An inclusive community for gaming enthusiasts

Music Forem Logo Music Forem Main Image

Music Forem

Follow

From composing and gigging to gear, hot music takes, and everything in between.

Vibe Coding Forem Logo Vibe Coding Forem Main Image

Vibe Coding Forem

Follow

Discussing AI software development, and showing off what we're building.

Popcorn Movies and TV Logo Popcorn Movies and TV Main Image

Popcorn Movies and TV

Follow

Movie and TV enthusiasm, criticism and everything in-between.

DUMB DEV Community Logo DUMB DEV Community Main Image

DUMB DEV Community

Follow

Memes and software development shitposting

Design Community Logo Design Community Main Image

Design Community

Follow

Web design, graphic design and everything in-between

Security Forem Logo Security Forem Main Image

Security Forem

Follow

Your central hub for all things security. From ethical hacking and CTFs to GRC and career development, for beginners and pros alike

Golf Forem Logo Golf Forem Main Image

Golf Forem

Follow

A community of golfers and golfing enthusiasts

Scale Forem Logo Scale Forem Main Image

Scale Forem

Follow

For engineers building software at scale. We discuss architecture, cloud-native, and SRE—the hard-won lessons you can't just Google

Crypto Forem Logo Crypto Forem Main Image

Crypto Forem

Follow

A collaborative community for all things Crypto—from Bitcoin to protocol development and DeFi to NFTs and market analysis.

Forem Core Logo Forem Core Main Image

Forem Core

Follow

Discussing the core forem open source software project — features, bugs, performance, self-hosting.

Parenting Logo Parenting Main Image

Parenting

Follow

A place for parents to the share the joys, challenges, and wisdom that come from raising kids. We're here for them and for each other.

Maker Forem Logo Maker Forem Main Image

Maker Forem

Follow

A community for makers, hobbyists, and professionals to discuss Arduino, Raspberry Pi, 3D printing, and much more.

HMPL.js Forem Logo HMPL.js Forem Main Image

HMPL.js Forem

Follow

For developers using HMPL.js to build fast, lightweight web apps. A space to share projects, ask questions, and discuss server-driven templating

Dropdown menu Dropdown menu Add reaction Like Unicorn Exploding Head Raised Hands Fire Jump to Comments Save Boost More... Copy link Copy link Copied to Clipboard Share to X Share to LinkedIn Share to Facebook Share to Mastodon Share Post via... Report Abuse

I use Visual Studio Code editor by Microsoft for Python development. I find below shortcuts and extensions particularly very useful during application development. Hope you find them useful as well!

Python extension for Visual Studio Code by Microsoft

With over 20 million installs, this is one of the most popular extensions for Python development in VS Code. Some of the commonly used editor options are:

  • Go to Definition (F12) jumps from the current code into the code that defines an object. This command is especially useful when working with libraries and want to learn more about them.
  • Peek Definition (Alt+F12), is similar, but displays the definition directly in the editor.
  • To run a specific section of code in Python, highlight the section and press shift + Enter. This runs just the highlighted portion of code from the Python file.
  • To enable brackets completion and linting - Press ctrl + shift + p and type settings.json to get the settings file. In settings.json file, add below:
{ "python.linting.enabled": true, "python.autoComplete.addBrackets": true, } Enter fullscreen mode Exit fullscreen mode
  • To get a printable reference of all shortcuts in VS Code: Press ctrl + shift + p and type Keyboard Shortcuts Reference in the search box. This will take you to the shortcuts link containing nice printable version of shortcuts in a pdf format.
  • Please note default keyboard shortcuts could be changed using Code > Preferences option.

Visual Studio IntelliCode by Microsoft

This is again another popular extension that helps with code completion. Pausing or pressing ctrl + space after module name activates and displays list of code completion options.

Better Jinja by Samuel Colvin

Jinja code added in the html template usually looks unformatted. To add colorization effect, install Better Jinja by Samuel Colvin. Then add below association in settings.json file

{ "files.associations": { "*.html": "jinja-html" } } Enter fullscreen mode Exit fullscreen mode

Flask snippets by cstrap

Flask snippets by cstrap provides shortcuts for generating commonly used snippets in Flask and Jinja. Once extension is installed, typing hw in the editor generates below snippet:

from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'Hello World!' if __name__ == '__main__': app.run() Enter fullscreen mode Exit fullscreen mode

Python DocString Generator by Nils Werner

This Python DocString Generator extension provides a consistent way to provide documentation to Python functions and modules.

References

https://code.visualstudio.com/docs/python/editing

pic Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Submit Preview Dismiss Code of Conduct Report abuse

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.

Hide child comments as well

Confirm

For further actions, you may consider blocking this person and/or reporting abuse

dev0928 Follow Full stack developer
  • Location United States
  • Education Master's in Computer Science
  • Joined May 11, 2020
Architectural Patterns #architecture #beginners What are type hints in Python? #python #beginners Intro to web app using AWS Serverless Architecture #aws #serverless #webdev #beginners
DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

Từ khóa » Visual Studio Code Run Python Keyboard Shortcut