Running two scripts in parallel in Pycharm
Asked Answered
H

4

30

I have two scripts, server.py and client.py.

I want to be able to start them running, in that order, with one action.

How can achieve that in Pycharm? Please note that I want to be able to set breakpoints

Haskins answered 13/6, 2017 at 9:9 Comment(0)
E
11

You can give Multirun a try:

Allows to run multiple run configurations at once: group multiple run configurations and start them in a single click. Not only application and test run configurations can be grouped, but other Multirun configurations can be organized into single run configuration.

It will let you run all configurations in Debug mode and use breakpoints.

Elviaelvie answered 13/6, 2017 at 9:26 Comment(0)
U
31

You can also do:

  1. Run -> Edit Configurations...
  2. Find and add a new "Compound" project
  3. Add your configurations into a single component
  4. Run it
Unapproachable answered 22/12, 2018 at 20:49 Comment(0)
T
21

Run -> Edit Configurations... Edit your script configuration Check the "Allow parallel run" checkbox at the top

Then just run then normally. You can also pin run tab to not be closed

Tequilater answered 17/10, 2020 at 6:7 Comment(1)
PyCharm 2023.2.5 (Professional Edition) it's Run -> Edit Configurations -> Modify Options (dropdown) -> allow multiple instancesEnvy
E
11

You can give Multirun a try:

Allows to run multiple run configurations at once: group multiple run configurations and start them in a single click. Not only application and test run configurations can be grouped, but other Multirun configurations can be organized into single run configuration.

It will let you run all configurations in Debug mode and use breakpoints.

Elviaelvie answered 13/6, 2017 at 9:26 Comment(0)
R
2

In the latest version of PyCharm (2023.3), you can enable parallel execution by selecting the Allow multiple instances option. To do this, navigate to Run -> Edit Configurations -> Modify Options and check the corresponding box.

Allow multiple instances (Parallel)

Roselane answered 27/2 at 7:8 Comment(1)
Thank you very much, this helped solve this issue for me. On windows (for those interested), it is the same procedure. Tick the box "allow multiple instances" and you're good to go.Duong

© 2022 - 2024 — McMap. All rights reserved.