In RStudio, you can run parts of code in the code editing window, and the results appear in the console.
You can also do cool stuff like selecting whether you want everything up to the cursor to run, or everything after the cursor, or just the part that you selected, and so on. And there are hot keys for all that stuff. 
It's like a step above the interactive shell in Python -- there you can use readline to go back to previous individual lines, but it doesn't have any "concept" of what a function is, a section of code, etc. 
Is there a tool like that for Python? Or, do you have some sort of similar workaround that you use, say, in vim?
Wing IDE, and probably also other Python IDEs like PyCharm and PyDev have features like this.  In Wing you can either select and execute code in the integrated Python Shell or if you're debugging something you can interact with the paused debug program in a shell (called the Debug Probe).  There is also special support for matplotlib, in case you're using that, so that you can work with plots interactively.
Is there something like RStudio for Python?