title: How can I run my currently edited file in a PyCharm console in a way that I can type into the command line afterwards?
body: <p>I want this so I can retain the command line history after repeated runs, and to paste lines from the console into tests etc. Exactly like in IDLE.</p>
  
  <p>[I realize this question is basically a duplicate of <a href="https://stackoverflow.com/questions/16874046/running-a-module-from-the-pycharm-console">Running a module from the pycharm console</a>. But the question there is not answered satisfyingly (for me), and my lack of reputation does not let me comment there, since I just signed up.]</p>