Prevent PyCharm from opening the browser/new tab on run
edit run configurations(right next to the play button at the top of the editor) and uncheck the box that says open new window on run .... – @Joran Beasley P/s: Just comment again.
For version 2018.3
- Go to File | Settings | Build, Execution, Deployment | Console.
- Check the option Use existing console for "Run with Python console".