简体   繁体   English

文件不导入 vscode

[英]Files don't import in vscode

I just started using vscode and my files in the same directory wont import to files in the same directory.我刚开始使用 vscode,我在同一目录中的文件不会导入到同一目录中的文件。 For example when I link to css or javascript files from an html file, they aren't read and the websits opens without the functions in the javascript file operating and same goes for the css file. For example when I link to css or javascript files from an html file, they aren't read and the websits opens without the functions in the javascript file operating and same goes for the css file. When I imported flask forms from a file to my main flask application page in python, it wouldn't work and I would get the error, 'no module named 'flaskform'. When I imported flask forms from a file to my main flask application page in python, it wouldn't work and I would get the error, 'no module named 'flaskform'.

What settings configurations am I missing for vscode? vscode 我缺少哪些设置配置?

If you are using the debugger make sure it uses the correct working directory.如果您使用的是调试器,请确保它使用正确的工作目录。
To use the current folder as the debugger working directory you can create a config file like described here .要将当前文件夹用作调试器工作目录,您可以创建一个配置文件,如此所述。
In this file you can add "cwd": "${fileDirname}" This works for Python debugging:在此文件中,您可以添加"cwd": "${fileDirname}"这适用于 Python 调试:

"configurations": [
    {
        "name": "Python: Current File",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal",
        "cwd": "${fileDirname}"
    }
]

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM