节选自Pycharm官方文档:http://www.jetbrains.com/pycharm/quickstart/index.html
Run and Debug Your Application
While working with PyCharm, you'll come to a moment when you need to run or debug an application, a script, or a test. In all these cases, you need a special profile, or a run/debug configuration, which defines script name, working directory, environment variables, and other vital things.
For each of the elements that can be run, there is a default profile, and you can easily launch such an element from its context menu, or with a handy shortcut Ctrl+Shift+F10 . However, if you want to use some other run/debug configuration, you have to choose one on the main menu, and then press Shift+F10.
PyCharm also helps those who love the full control of an interactive console: on the Tools menu, you can find commands that launch the interactive Python or Django consoles. Here you can type commands and execute them immediately. Moreover, PyCharm's interactive consoles feature syntax highlighting, code completion, and allow scrolling through the history of commands (Ctrl+Up/Down).
Oops... your application or script runs into a run-time error? To find out its origin, you will have to do some debugging. It starts with placing breakpoints (quite simple - just click the left gutter of the line where you want the breakpoint to appear), at which program execution will be suspended, so you can explore program data:
Launching the debugging session is quite as simple: either use the context menu of a specific script, or select a suitable run/debug configuration, and then press Shift+F9 .
And finally, a very convenient way to select run/debug configuration and immediately launch it isAlt+Shift+F10/ Alt+Shift+F9.
用 Ctrl+Shift+F10 就可以快速切换主程序,方便运行