Python With Visual Studio Code – A 5 Step Guide

I am a student of Python and I will try to present a step by step guide about ‘How To Use Python With Visual Studio Code?’. I will be listing down the steps I found and followed to setup Visual Studio Code to debug and run python code. If you think I missed something please do let me know in the comments section.

Step 1: Install Python

It sounds very obvious to many but, for those who are new to Python as well as Visual Studio Code I would like to inform you that Visual Studio Code can be used to debug and run Python code. But, ‘Visual Studio Code doesn’t come with Python‘. So, we will have to install python separately. Please use this official Python download link to get the latest Python. (There is big debate whether to use Python 2.x or 3.x? I don’t want to get into it for now. Just use the latest version of Python. That’s what sane people say!). Python installation is very simple i.e. Double click!

Tips :

  1. I prefer to use custom path for Python installation e.g. “C:\Python\” because the default path C:\Users\<user name>\AppData etc. etc. is not easy to find on the machine.
  2. If you are new to Python do not touch other default options.
  3. Python 3.6+ has a new option at the end that can disable MAX_PATH limit. Disable that limitation. It’s good.

Python Installation

 

Step 2 : Install Visual Studio Code

Now another (obviously) important step is to install Visual Studio Code. Visual Studio Code is a Microsft’s free Code editor. You can visit it’s official website for further details. But, in short it is Visual Studio without any compiler. It’s only a code editor. Users have to install plugins in order to perform certain tasks which are particular to the programming language. Visit it’s official download page, download the latest version and install. You can choose 64x or 32x as per your choice.

Visual Studio Code Welcome Page

Tip: You can choose to select auto installation for supporting tools for Python from Welcome page. (Please see at top right of the Welcome page) Or you can install the extensions Individually as I will mention in Step 3 below.

Step 3: Install Extensions For Python

Click on the Square button on left button panel. It is is the ‘Extensions Button’. Natural question is ‘Why do we need extensions?’ Answer is simple, ‘Because Visual Studio Code is just a Code Editor and is not built to compile any code as such. So, to help coupling the compiler and Visual Studio Code, we need Extensions’

Please install the following Extensions as shown in the picture below. (Use search box at the top for finding these Extensions). These extensions are more than sufficient to debug and run a Python code

  1. Python
  2. Python for VSCode
  3. MagicPython
  4. Python Extended

Python Extensions for Visual Studio Code


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值