使用Vscode写python

在python官网下载好python2.x 或者 3.x, 然后在vscode 下载python插件. 

写一个python程序, 运行, vscode会自动提示你配置python执行路径,并帮你创建好.vscode文件夹. 

除了task需要配置外,其他的vscode都会自动帮你配好. 下面讲一下怎么配置task使得可以用contrl+shift+B就运行程序.

(也可以使用shift+enter来运行部分选中的代码,但是没有整体性. 运行爬虫代码时总是有莫名其妙的错误,但是在IDLE里面却没错)

写好python程序, 按ctrl + shift + B, 在提示界面选择最下面的other. 在自动创建的task文件里面进行配置,配置文件如下:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo", "type": "shell", "command": "C:/Python/Python37/python.exe", "args": [ "${file}" ], "group": { "kind": "build", "isDefault": true }, } ] }

猜你喜欢

转载自www.cnblogs.com/DSYR/p/10320092.html
今日推荐