简体   繁体   English

在 Visual Studio 代码中运行 python 代码?

[英]Running python code in Visual Studio code?

Please do not close this question.请不要关闭这个问题。 It's so hard to get started.很难开始。 I wanted to learn to program, I followed a python tutorial that used VS Code as the IDE.我想学习编程,我遵循了使用 VS Code 作为 IDE 的 Python 教程。

          def main():
           print("hello wrld")
          main()

He wrote the above code and in VS Code clicked on the debug icon, this icon can not be seen on my version of vs code, it shows an icon called Run.他写了上面的代码,在VS Code中点击调试图标,这个图标在我的vs code版本上看不到,它显示了一个叫做Run的图标。 When I go to the top menu and click on Run, then start debugging, it open the chrome browser instead of running my code.当我转到顶部菜单并单击运行,然后开始调试时,它会打开 chrome 浏览器而不是运行我的代码。 Why does it open chrome?为什么打开chrome?

在此处输入图片说明 Go to extensions and download the python compiler.转到扩展并下载 python 编译器。 Then make sure your file is of .py extension then a run symbol should come up and run in the console然后确保您的文件是 .py 扩展名,然后应该出现一个运行符号并在控制台中运行

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

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