I would like to modify the default run (not debug) behavior in Pycharm to include the -O
flag, as indicated in this answer.
The information in this answer on creating a run configuration is helpful, but I have many files with if __name__ == "__main__"
blocks that I need to run locally, and I would like Pycharm to automatically execute them with the -O
option during a "run". The debug behavior should remain unchanged and the -O
flag shouldn't be set.