Interacting with program after execution

Solution 1:

in Pycharm, Run/Debug menu choose Edit Configuration, check the box before 'Show command line afterwards'

Solution 2:

UPDATE
Starting with version 4.0 there's an option Show command line afterwards (renamed in later versions to Run with Python console) when editing run/debug configuration in Run|Edit Configurations....


From output of python --help:

-i : inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x

To set interpreter option in PyCharm go to Run|Edit Configuration

Solution 3:

Click Run -> Edit Configurations...,

Then check the box Run with Python console.