visual studio Code提供一个非常清爽的编辑页面,看起来非常的高级,当你通过该软件进行python程序的编辑时,但是发现该软件无法进行Python程序的运行,其实在Visual Studio Code中并没有直接帮你安装Python,因此当你无法运行的时候,你可以查看Visual Studio Code是否安装了Python,同时也要检查自己的代码是否是写完整的,如果代码没有写完整,或者是写错了,同样也会造成代码无法运行的情况,小编针对这个问题给大家讲解一下如何使用Visual Studio Code运行Python程序的具体操作方法吧,如果你需要的情况下可以看看方法教程,操作方法不会很复杂,一起看看吧。

方法步骤
1.小编这里从新建文件开始演示一下全过程,首先用鼠标右键在桌面上点击一下,选择新建一个文件夹,并且给文件夹设置一下名称。

2.接着我们进入到Visual Studio Code的页面中,在该页面的左上角将【文件】选项进行点击打开,选择【打开文件夹】。

3.在打开的窗口中,将自己刚刚新建的文件夹找到,将该文件夹选中之后点击右下角的【选择文件夹】。

4.随后添加进来的文件夹会显示在页面左侧位置,我们将该文件夹后面的第一个图标进行点击,进行新建一个文件。

5.随后在下方会出现一个编辑框,在编辑框中输入一个文件的名称 ,而该名称的后缀名必须为【.py】。

6.接着就可以在右侧的页面中进行代码的编辑了,如图所示。

7.如果你发现无法运行该代码的话,那么我们点击左侧的箭头所指的图标,然后在打开的页面出现一个【Python】安装的提示,点击【安装】按钮即可安装。

8.随后我们将左侧的我们刚刚编辑的文件进行右键点击,选择【在终端中运行Python文件】,随后在右侧页面的底部就会进行我们编辑的代码运行状态,如图所示。

以上就是关于如何使用Visual Studio Code运行Python文件的具体操作方法,Visual Studio Code是非常好用的代码编辑软件,很多专业小伙伴都会使用该软件进行代码的编辑,同时我们编辑好代码之后,可以通过上述方法来运行,如果无法运行的话,那么检查一下是否安装了Python,没有安装的话,点击安装即可运行代码,感兴趣的话可以操作试试。