Is There Any Keyboard Shortcut To Run Code From Visual Studio Code?

Python Forum Python Forum
  • View Active Threads
  • View Today's Posts
  • Home
  • Forums
    • View New Posts
    • View Today's Posts
    • My Discussions
    • Unanswered Posts
    • Unread Posts
    • Active Threads
    • Mark all forums read
  • Staff List
  • Member List
  • Help
  • Calendar
  • Search
  • Statistics
  • Interpreter
  • IRC
Is there any keyboard shortcut to run code from Visual Studio Code?
  • Python Forum
  • Forum & Off Topic
  • Bar
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes Is there any keyboard shortcut to run code from Visual Studio Code?
python300 Silly Frenchman Posts: 24 Threads: 8 Joined: Jun 2017 Reputation: 1 #1 Jun-04-2018, 07:33 PM (This post was last modified: Jun-04-2018, 07:46 PM by python300.) I know you can right click in the editor and select Run Python File in Terminal. Or I can right click the name of the python file from left panel and select Run Python File in Terminal. But what i am trying to find is if there is a keyboard shortcut to run the code? My bad. I was missing code runner extension and so was unable to see the Run triangle symbol at the top of code editor. Once I installed Code Runner, I can see the Run Code symbol (triangle) and om highlighting it, I see the shortcut Ctrl + Alt + N Reply Find Reply python300 Silly Frenchman Posts: 24 Threads: 8 Joined: Jun 2017 Reputation: 1 #2 Jun-04-2018, 09:39 PM (This post was last modified: Jun-04-2018, 09:39 PM by python300.) I have installed Visual Studio Code and added extensions - Python, Code Runner. With Code Runner, now I can see the Run Code symbol (triangle) and on highlighting it, I see the shortcut Ctrl + Alt + N But when I try to use it to run the code that asks for user input, I can't find a way to provide the input. When I try to enter user input, I get error message "Cannot edit in read-only editor" I think this is because I am missing some configuration part for Code Runner like setting up PATH or some other Workspace settings. Please assist me in identifying what all configuration will I need to do and how? [UPDATE]: I did select "Add Python 3.6 to PATH" while installing Python. I have attached screenshots for reference. Note: Even now when I right click and select "Run Python File in Terminal" for the same program, I can enter user input fine and get the expected output. Reply Find Reply snippsat Administrators Posts: 7,398 Threads: 123 Joined: Sep 2016 Reputation: 511 #3 Jun-04-2018, 11:35 PM Install Code Runner,get a button and shortcut Ctrl+Alt+N. Can also build own task that run Python. Reply Find Reply python300 Silly Frenchman Posts: 24 Threads: 8 Joined: Jun 2017 Reputation: 1 #4 Aug-07-2018, 09:12 PM Finally I got answer to my second question (which I wanted to post as a new question) from SO. Answer: You can provide input by telling code runner to use the terminal. To do this, there is a setting called code-runner.runInTerminal, set to false by default, that you can set to true. In the lower left hand corner of the screen on "VS code" you'll see the icon which will take you to settings when clicked. Thank you to the helper who answered it there. I wanted to post that answer here so if someone like me comes here searching for the same thing, he/she will find help here. Reply Find Reply
Possibly Related Threads…
Thread Author Replies Views Last Post
Autocompletion for Python in Visual Studio user3481 1 3,223 Dec-10-2020, 12:03 PM Last Post: snippsat
Installing the Visual Studio Code on Linux - how to do that!? apollo 4 5,896 Oct-05-2019, 09:48 PM Last Post: apollo
Users browsing this thread: 1 Guest(s)
  • View a Printable Version
Forum Jump: Private Messages User Control Panel Who's Online Search Forum Home Python Coding -- General Coding Help -- Data Science -- Homework -- GUI -- Game Development -- Networking -- Web Scraping & Web Development General -- News and Discussions -- Tutorials ---- Tutorial Requests and Submissions ---- Python Installation and Execution ---- Fundamentals ---- Common pitfalls and what to do ---- Web Scraping ---- Web Tutorials ---- GUI tutorials ---- Game Tutorials ---- Networking Tutorials -- Code sharing -- Code Review -- Jobs Forum & Off Topic -- Board ---- Weekly Top Picks -- Bar Powered By MyBB, © 2020 Designed byrain. Forum Stats Contact Us Lite (Archive) Mode RSS Syndication Dark Light

User Panel Messages

Log Out My Profile Pay your profile a visit User Control Panel Do some changes on your profile My Messages View private messages unread Avatar Change avatar Signature Change signature
Announcements
Announcement #1 8/1/2020 Announcement #2 8/2/2020 Announcement #3 8/6/2020

Login to Python Forum

Enter your details to login to your account: Remember me Lost Password? Login Don't have an account yet? Sign Up! Linear ModeThreaded Mode

Từ khóa » Visual Studio Code Run Python Shortcut