How to Setup Python 3.12 in Visual Studio Code | Run Python in VSCode (2024 Update)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's see how we can set up python 3.1 2.1 in Visual Studio code and how we can create our first python project and run first go to this URL H over this downloads button no need to click on this now as you can see you will see this option python 3.1 2.1 click on this and your python 3.12 will start now click on open file to open your installer click on add python.exe to path and click on install now now if you asked want to allow this app to make changes to your device click on yes now as you can see you will see this message setup was successful now you can click on close and your python is successfully installed now let's check our python version type python Double Dash version and as you can see our python is now successfully installed now that we have installed python in our system let's open Visual Studio code and install all necessary extensions to run python open a video Studio code and let's open a new folder where we will create a project that will contain our python file or python code right so I'll just go to desktop and create a new folder here and call it my P pjc right and click on select folder so as you can see here my pro project is open but there is no file here because we have not created any file so let's create a main.py file and this main Pi file will contain our code so immediately as you can see here you'll see a message that says do you want to install the recommended python extension you can click on install or you can click on show recommendations but for now I'll just close this and I'll show you how you can do it manually because you need to learn how to do it manually so here let's say we want to write hello world right hello world from python save this now go to extensions and search for python so we have our python code now let's see how we can execute this click on this and click on install now this will install the python code formatting refactoring and all that stuff with a python debugger as you can see this debugger is also installing so let's wait until this is finished so as you can see here the extension is now installed now you can go back to your file right you can close this extension now to run this click on run and then click run without debugging now you will be asked what to do click on python debugger and it will give you this message you need to select a python interpreter before you start debugging right because we have not selected any interpreter for that click on change python interpreter and we just installed python 3.1 2.1 right these three I already had those install so click on this one that we just installed click on this and as you can see down here 3.1 2.1 is now selected now you can just click on run and run without debugging and python debugger and this time our python code as you can see is being executed and hello world from python is printed now you can write any python code here let's say a equals to input enter number here and we print the number into 10 now let's run this and as you can see it is saying enter number here let's input 67 and now we have 670 printed because we are multiplying that number with 10 so this is how you can set up Python and write python code in Visual Studio code if you have any questions let me know in the comments below
Info
Channel: The Code City
Views: 1,055
Rating: undefined out of 5
Keywords: how to setup python 3.12 in vscode, setup python in visual studio code, run python in vscode, run python in visual studio code, install python in vscode, create python program in vscode, how to run python in vscode, how to install python in vscode, python project in vscode
Id: 5SsRK0q6RvE
Channel Id: undefined
Length: 4min 2sec (242 seconds)
Published: Mon Feb 05 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.