首页 > 编程语言 > 详细

使用Vscode写python

时间:2019-02-05 17:21:25      阅读:186      评论:0      收藏:0      [点我收藏+]

在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
            },
        }
    ]
}
技术分享图片

 

使用Vscode写python

原文:https://www.cnblogs.com/DSYR/p/10320092.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!