Using the Python extension of Visual Studio Code, I can select some code, right-click it, and select \"Run Selection/Line in Python Terminal\" (alternatively, I can hit Shif
IPython support is provided by "IPython for VSCode" plugin.
Just select the text and invoke 'Send Selected Text (or current line) To IPython' in command palette.
Also official Microsoft Python plugin now supports interactive Jupiter windows, with similar functionality.