To run a Python script, you can: 1. Run the script directly; 2. Configure the run configuration; 3. Use the debugger. Shortcut keys: run Shift F10 directly, debug and run Ctrl Shift F10 (Windows/Linux)/Cmd Shift F10 (macOS), stop running Ctrl F2 (Windows/Linux)/Cmd F2 (macOS).
How to run Python in PyCharm
Run the script directly
To run a Python script directly, follow these steps:
Configuring the run configuration
You can also configure more advanced run configurations, such as setting parameters, specifying the working directory, or using the Python interpreter.
Using the debugger
PyCharm has a powerful debugger that can be used to step through code, set breakpoints, and inspect variables.
Shortcut keys
The following shortcut keys can easily run Python scripts:
Shift
F10
Ctrl
Shift
F10
(Windows/Linux) or Cmd
Shift
F10
(macOS)Ctrl
F2
(Windows/Linux) or Cmd
F2
(macOS)The above is the detailed content of How to run python with pycharm. For more information, please follow other related articles on the PHP Chinese website!