Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Visual studio shortcut key to add comments to python code
#1
Hi,

I am using Visual Studio 2019 as my IDE for writing python codes.
I was wondering how an earth do you add comments to a block of code?
I can't see any options in the menu bar.

Thanks!
Quote
#2
https://www.zentut.com/python-tutorial/python-comments/
Quote
#3
# This is a one line comment in Visual studio. The below one is multiline
"""
This is a comment
This is another comment
"""
pyzyx3qwerty
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Quote
#4
Basically, when you want a comment, the best way is to think of it as hashtag. You put # on the line of code you want the interpreter to ignore.
Quote
#5
What I meant was is there a button in Visual Studio to comment out a block of code in python?
Quote
#6
select a block of code and press ctrl+/
Quote
#7
In mac, select a block of code and press command KC
https://npsedu-my.sharepoint.com/persona...origin=717
pyzyx3qwerty
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Quote
#8
I have windows and i tried ctrl + / and it didn't do anything Confused
Quote
#9
Try Ctrl K C
pyzyx3qwerty
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Quote
#10
(May-24-2020, 10:07 AM)mp3909 Wrote: I have windows and i tried ctrl + / and it didn't do anything
Probably you are doing something wrong. Attached is screenshot from VS Code under Windows, EDIT menu.
As you can see shortcut for Toggle Line Comment is Ctrl + /
and shortcut for Toggle Block Comment is Shift + Alt + A

   
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to create a shortcut of your python program on your phone screen (using Q3Python) Alexx 0 283 May-20-2020, 06:10 PM
Last Post: Alexx
  Python Shell As Preferred Mode For Integrated Terminal In Visual Studio Code adt 4 457 Sep-07-2019, 06:00 PM
Last Post: adt
  Trying to make a shortcut key to execute program 357mag 1 369 Apr-12-2019, 08:36 PM
Last Post: Yoriz
  Visual studio and Afzal 0 441 Feb-20-2019, 11:10 AM
Last Post: Afzal
  Python in Visual Studio “15” Preview snippsat 5 12,581 Oct-17-2016, 06:43 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)