简体   繁体   中英

How to run the code in the active tab in PyCharm?

I know it is not that cleaver question, however I am pretty new to PyCharm and Python.

So as the question tells, I would like to make a shortcut to run the code in the active tab without going to the window "Edit Configurations" and change the running script manually.

I use OS 10.9.1, PyCharm edition 3.0.2

You can simply right click and run:

在此处输入图片说明

Go "Settings -> Project Interpreter -> Python Interpreter" and add your interpreter (the green '+' at up right corner of "settings" windows).

Then, already will available the green Play button (together the 'bug' icon) to run your project from Pycharm.

For MacOS (10.5 keymap):

Ctrl + Shift + R

在此处输入图片说明

Not sure why the windows answer was accepted...

Sorry for being so late but I was having the same problem. Maybe will help others in the future.

In PyCharm version 2021.2.1 go to:

File --> Settings --> Keymap --> Run Context Configuration --> Right Click --> Add Keyboard Shortcut.

The screenshot bellow will help you more.

PyCharm 快照

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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