Getting Started with Python in Visual Studio Code | Python with VSCode
Video Title: Getting Started with Python in Visual Studio Code | Python with VSCode
Hey guys in this video I’m going to show you how you can get started with Python on your visual studio code editor using your Windows 10 operating system so let’s get started so to start with you need to have Python installed on your Windows 10 operating system and also I’m
Hoping and expecting that you already have installed Visual Studio code on your Windows 10 operating system now to check where the Python is installed I am going to right click on my windows icon here and open the command prompt and here I’m going to just type Python and
Then space – – version and then press Enter and you can see I have Python three point seven point four installed on my Windows operating system so make sure that python is installed and also visual studio code is installed so you can see visual studio code is already
Installed so now the only thing remains is I need to open the Visual Studio code and create my project so to start with because this is a Python development kind of tutorial I’m going to open the command prompt and I want to show you some more things so you can go to your
Chosen directory let’s say I want to just create a project inside my desktop directory so I’m going to just type desktop CD desktop and then I’m going to create a directory using mkdir command and then the name of your directory which you want to create so let’s say I
Want to create a directory called books so I’m going to just give this command mkdir work which is going to create this directory in your desktop right so you can CD to your work directory so now you are inside your work directly in the terminal so you can directly open visual
Studio code inside this directory using this command code space dot so just keep this comma and then press Enter which is going to open visual studio code on the same directory you can see so now the work of this terminal is done so I’m going to just close this terminal so now
We want to create some Python script and we want to run this python script using visual studio code and also we want to debug our python script using visual studio code so let’s create a python file first of all so i’m going to just create a test dot py file and then press
Enter which is going to create this file and as soon as you create this file inside Visual Studio code straightaway this message will pop up which says the python extension is recommended for this file type so if you want to install it you can just click on the install button
If you don’t want to install it straight away from this message you can also go to this last option which is called the extensions and just click on this here also you can search for Python inside the search for box or you will see in the recommendation this Python plug-in
Also so for example I just type here Python and the first result here will be the Python plug-in extension you can also read more about this extension by clicking on this extension right so this is the same extension which is recommended by visual studio code to us
Which is this pop-up right so if you just click on the install button it’s going to install the Python extension and you can see how many number of time it is downloaded it is downloaded about 62 million times so it’s the most popular or one of the most popular
Extensions which is provided by Microsoft that’s also important right so I’m going to just click on install button which is going to install this Python extension you can see some more extensions also here for example Python for visual studio code which is also relatively popular you can see 1 million
Downloads of this extension and you can see many more extensions when you just type here Python so for example Python preview or Python path so now you can see that this python extension is added to our Visual Studio code and at any time you can also uninstall this
Extension by clicking on the uninstall button so once this extension is installed just go to your Explorer once again I’m going to just close this page from here and now you can also see some tips and recommendations from your visual studio code editor which is to install pee violent extension so this
Time I’m going to just directly click on this install button which is going to install this pee violent extension on our Visual Studio code so you can see it’s installing this package and you will also observe that this package is just a pip package and you can see this
Command is already given on your terminal which is PIP install a pee violent for this user so if you want to install pee violent manually you can also give this command using pip so you can just write pip install pee by length and this procedure is same as what
Visual Studio code is doing for us right I’m going to just close this recommendation because we have already installed the python extension for the Visual Studio code and now you can see that the py length the extension is also installed so you can see this terminal is also available inside your Visual
Studio code from where you can run your script directly so I’m going to just close this terminal for now and I’m going to show you how you can open it once again you can go to the view and then from here you can just click on the
Terminal which is going to open the terminal if you want to open multiple terminal you can just click on this plus button and you can see there are multiple terminals open which you can switch using this menu bar from here right so let’s just create some code so
I’m going to just define for example msg for a message is equal to hello world let’s say we want to print hello world on the terminal and then inside this print function I’m going to just pass my MSG variable so once you have done writing your code you can right click on
The same file and then you will see this option which says run Python in terminal which is going to run your python script inside your terminal so I’m going to just click on this option and you can see it runs this Python script using Python on your terminal and it prints
Hello world here so you can see this output hello world also if you want to increase the font size you can just go to file and then go to the Preferences here and then click on settings which is going to open this window and then you
Can go to the text editor here and then go to the font and I’m going to increase this font size to let’s say 18 and then press ENTER which is going to increase this font size to 18 you can see the font size is now increased you can also
Do it let’s say 20 which is going to make this font little bit more bigger so let me just close this window once again and let’s concentrate on our Python script now let’s try to do it manually we have just ran our script using just right clicking on the file and then
Choosing this option but you can run your python script using the command line simply so you can just write python and the name of your script which is a test in our case and because it’s PS terminal which is a PowerShell terminal that’s why it’s adding this dot
And this backslash here otherwise we could have just used test dot py also on your Linux operating system and it will run fine also so you can see the same result here also you can see on the left hand corner this Python version which is available for your visual studio code so
You can see python 3.7 point for 64-bit version is used by Visual Studio code on our Windows 10 operating system so now let’s try to debug our code so to debug our code we just need to give the breakpoint breakpoint you can give from here so just click on the Left bar here
And then you can see the red dot that means we have set the breakpoint and then you can just go to the debug options and right now there is no configuration here so when you click on this spanner option you can see this round I can here you will be able to see
The first option here it says python file so you can just click on this python file which is going to create this launch dot jason file inside your project so now you can see there is a folder which is created which is called dot vs code and inside this dot vs code
Your launch dot JSON file is there but let’s not just concentrate on this launch dot JSON file yet we want to debug our code so we just want to click on the debug option and once you have clicked on the python file options you will be able to see python here or when
You drop this menu you will be able to see python here once you have clicked this open launch date JSON file and then you can see this green button here so I’m going to just click on this green button which is going to start the debugging of the python script so debugger has
Been started and in some time you can see that our debugger is stopped at this breakpoint which we have set for our print function and on the left hand side you can see the local variables here so there is only one local variable which we have defined which was this message
Variable and also there are so many built-ins which are available inside your standard Python so those are also shown here if you want to watch any variable you can also write the name of that expression for example MSG and then I’m going to just press ENTER and it’s
Going to give you the value of that expression so I have just added this expression and it shows me hello world also there is a call stake here and you can see the breakpoints here you can also see these button first button here is for the continue second is for step
Over third is for step into and the fourth button is for step out and this button is to restart your debugging and the last button is for stop your debugging so let’s say I’m going to just click on continue button which is going to just continue the script after the
Breakpoint and it’s going to show us this output once again when you run your debugger your debugger is going to stop at this breakpoint which you have set so this is how you can debug your code you can also restart your debugging by just pressing the restart button and it’s
Going to restart your debugging so let’s stop our debugging for now and let’s go to our script once again now let’s see how the intelligence work in your visual studio code for python so we have declared this variable called MSG when you write for example dot here you will
Be able to see bunch of functions which you can apply on your a string variable for example capitalized or all these functions which are available here so let’s say we want to apply this lower function and when you try to complete this function using this parenthesis
It’s also going to show you what this function is going to do so it’s going to return the copy of the string converted to the lowercase right so this is how you can use the intellisense if the intellisense is not working you just need to relaunch your Visual Studio
Codes because sometimes you need to restart your Visual Studio code on your Windows operating system after installing the extensions so we have installed the python extension and if you don’t restart it sometime it’s not going to work so try to restart your Visual Studio code and then try to use
This intelligence and it’s going to work most probably so this is how you can get started with python on your Visual Studio code editor inside your Windows 10 operating system I hope you have enjoyed this video and I will see you in the next video
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
How to Set Up Python in Visual Studio Code on Windows 11 – https://youtu.be/daCSwO-T7sY
Can't say anything but thank you
Perfectly explained..
How does this have 2mil views but 13k likes and 200+ comments
I'm new to this. So how do we save this progress?
At the Left corner I cannot find my python version
thks sir for making informational video ❤❤❤❤❤❤
So why does mine keep coming out of debug mode (i.e the bottom bar turns from blue, the back to its original colour)? The most ridiculous application I have ever used.
great video, nice and simple explanation
You know yous are one of my favorite channels?
Just wanna to let you know this)
Always very helpful
❤
Very well presented for beginners. Appreciate!
i dont know if he is german, indian or british
thanks very much – nice clear video – many thanx :¬)
Good one <3
how do you increase font size in terminal?
A very-very basic tutorial.
I am having difficulty in changing directries and making new directries too, why so difficult?
Many times I have trouble following tutorials on youtube, but you said one thing repeatedly that made it easy to follow: “Here’s how I did that…”! So many times the narrator in “how-to’s” races along at 80 mph with “now I just bring up the klanger tool, then I…” leaving us going “wait—what’s a klanger tool? What did he do to bring it up?” I wouldn’t be watching a tutorial if I knew how to use the feature! Thank you!
Great lntroduction sir
That is very great as nice key to open Python for work.
Could understand nothing complete waste of time
any body else watch this to make a py csgo hack
great video thanks
complicated
You are a genius, I tell my friends to watch you instead of Linkedin Learning
Simple and you teach things ppl actually need to know!
please, next time stop saying the word button
Thank you this was very helpful
👍🙏💪
thank you
all my terminals say powershell. no python terminal. i do have python and the extensions installed.
Thankyou so much sir for helping me😔😇❤🙏
You helped me a lot. Thanks man