简体   繁体   English

在Windows 10的Visual Studio代码中使用python配置任务

[英]Configure task using python in visual studio code for windows 10

I'm using vs code 2.0 with python 3.6 and want to configure a task to run he the current python file. 我正在将vs code 2.0与python 3.6配合使用,并希望配置一个任务以运行当前的python文件。 The tasks.json file has the below lines tasks.json文件具有以下tasks.json

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
    {
        "taskName": "echo",
        "type": "shell",
        "command": "echo Hello"
    }
]
}

How to fill the lines to fit my needs. 如何满足我的需求。 I tried many solutions with no avail, especially the one here Configure Vs code version 2.0.0 Build Task for python it shows the below error 我尝试了许多无济于事的解决方案,尤其是这里的配置VS代码版本2.0.0的python生成任务,它显示以下错误

> Executing task: python d:\books\programming Languages\python\Projects\.vscode\tasks.json <  
C:\Users\[myuser]\Anaconda3\python.exe: can't open file 'd:\books\programming': [Errno 2] No such file or directory
 The terminal process terminated with exit code: 1

Please help in steps because I'm very new to python. 请逐步提供帮助,因为我是python的新手。

Minimum configuration: 最低配置:

{
            "version": "2.0.0",
            "command": "python",
            "args":["${file}"]
        }

Optimal configuration you can find here: 您可以在此处找到最佳配置:

Configure Vs code version 2.0.0 Build Task for python 为python配置Vs代码版本2.0.0生成任务

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Windows 10 中,如何配置 Visual Studio Code 以查找 Python 3 解释器? - in Windows 10, How to configure Visual Studio Code to find the Python 3 interpreter? 在 Windows 10 上的 Visual Studio Code 中配置 Python - Configuring Python in Visual Studio Code on Windows 10 如何在Windows 10中配置Visual Studio Code以忽略工具栏并使用Python解释器路径? - How to configure Visual Studio Code in Windows 10 to disregard shebangs and use a Python interpreter path? 配置Visual Studio代码以在Windows上以bash运行Python - Configure Visual Studio Code to run Python in bash on Windows 在 Windows 10 上设置 Python(在 Visual Studio 代码中) - Setting Up Python (in Visual Studio Code) on Windows 10 配置 Visual Studio Code 以使用正确的 Python - Configure Visual Studio Code to use the correct Python 在 Visual Studio Code 中为 Python 创建简单任务 - Create simple Task for Python in Visual Studio Code 在Windows上从bash运行venv在Visual Studio Code中配置Python路径 - Configure Python Path in Visual Studio Code with venv running from bash on Windows 尝试在 Windows 10 上打开任何 Python 库时,Visual Studio Code 中的“DLL 加载失败” - "DLL load failed" in Visual Studio Code when trying to open any Python library on Windows 10 使用 Visual Studio 2013 在 Windows 10 上使用 contrib 模块为 Python 编译 OpenCV - Compile OpenCV for Python wit contrib modules on Windows 10 using Visual Studio 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM