How to change command line when running a script with the green run-triangle


Hello everybody,

I have the same problem as this guy here:

In short, I would like to start my scripts not as python test/ but as python -m test.tests

That's not a problem from the console, but how can I get the same behavior when I start/debug/profile a script from the GUI / file context menu with the "green triangle"?

Best regards,



Hi Michael! When you run script from the context menu, PyCharm generates a new run configuration. After that you can go to Run | Edit configurations, select your run configuration and provide interpreter option "-m". Does it help?