Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
73 views
in Technique[技术] by (71.8m points)

How to set Python console in VS Code?

This is my first question here. I just moved from Spyder to VS Code and in Spyder if I wanted to run my code I would just press F5 and it would run in the console, but in VS Code I need to press F5 then enter and wait a bit until the powershell runs the file and then see the output. Is there a way to make that faster?

Thank you very much!

question from:https://stackoverflow.com/questions/65621365/how-to-set-python-console-in-vs-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yep, you can do it by setting a shortcut editing keybindings.json file. Pressing ctrl + k + s (if you haven't changed before) you can open it and then type run python file in terminal, then click on it and set the shortcut that you wanna press to run the current python file. I'm attaching an image to support the explanation.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...