The default build system for Python should do that for you. Make sure it's the selected build system and press F7. If you want to *see* the actual console, you will need to create your own build system, though, and use that instead.