0

I am trying to set up a Pycharm run configuration. Before my application starts, I have a python function that needs to run to set some environment variables. I configured my script to run in the Starting script for the Python Console.

pycharm console configuration

Then I set up the Run Configuration to run in the python console.

Pycharm run configuration

This works well when I run my application. I can see from my print statement that this code is executing.

Startup script executing

However, when I try to debug my application, the start up script is not being run and I cannot debug my application. How can I get my script to run when I debug in the same way it does when I run the project?

Alternatively, if I'm on the wrong track with the way to run a startup script, is there an easier way to do this?

ScoobyDrew18
  • 633
  • 9
  • 20
  • Two of the better posts that explore some ways of doing this are [this one](https://stackoverflow.com/q/42419019/) and also [this other one](https://stackoverflow.com/a/60815354) – bad_coder Sep 28 '22 at 06:00

0 Answers0