As an aside, I really wish the VSCode team did more to integrate iPython REPL more seamlessly into VSCode as that is one of the big blockers for me to using VSCode for anything Python related.
As an aside, I really wish the VSCode team did more to integrate iPython REPL more seamlessly into VSCode as that is one of the big blockers for me to using VSCode for anything Python related.
I don't use VS Code myself, but I think the team is doing in increasingly better job, Microsoft is just a huge beast. I would also love for some IPython feature to get into Core Python. But that might just take time as I don't think many Core Python Dev do that much interactive coding, and thus don't see that much the interest of doing so.
BTW it's uppercase I and P, we don't want to be in trouble with a billion dollar fruit company, even if we predate their use of iPxxxx
Thanks for your work on it, it really is much appreciated.
VS recently made big changes to notebooks support [1], and they are now fully integrated into VS with their own Notebooks API. I've been following the changes for the past year on VS Code Insiders and the latest integration is really impressive from a UI and developer point of view. What's more is VS Code lets you easily use notebooks with any language (not just Python). I've had a really good experience so far using Julia kernels.
[1] https://code.visualstudio.com/blogs/2021/11/08/custom-notebo...
Does the PyCharm integration offer something more capable? I'm interested in what I'm missing out on!
1. Multi-line text support and auto indentation support. This is *huge*. Most python REPLs are terrible at this including the default interpreter. You can easily copy paste code from scripts/modules into the REPL and the interpreter just handles everything seamlessly. It is even smart enough to remove a global indent across all the pasted code (if you copied code from within a function that was already indented 1 level up). It makes the REPL experience really really smooth.
2. Tab completion works beautifully with hover overlays
3. The integrated variable viewer is extremely good and you can easily view the local state of your interpreter and explore data/variables. The integrated Pandas dataframe and Numpy array viewers (available even in the free version) are really handy as well.
4. You can even attach a debugger to an interactive REPL session and if you then have breakpoints defined in associated libraries in your Pycharm IDE and then invoke code that would hit the breakpoint, it will pause at the breakpoint and give you the full debugging experience. This is really handy for reducing the time to debugging and investigating issues in code.
5. Matplotlib eventloop is handled very well in Pycharm which basically means that interactively plotting in the IPython REPL using matplotlib works seamlessly.
6. You also get some amount of linting/error checking in the REPL and also syntax highlighting, which is really helpful as well.
7. The IPython interpreter *is the default interpreter* which means that even when you debug code (with breakpoints for example), you get all of the benefits above while debugging, which is a really nice experience, especially with having access to the variable viewer.
8. Another annoyance I had with VSCode last time I tried using it is that the debugger while vastly improved still only allowed single line of code entry and was generally clunky if you wanted to paste multiple lines of code into the debugging REPL. Since you get the full IPython shell in Pycharm at all times (debugging or otherwise), it ends up being a lot more powerful and easier to use.
9. This is underrated, but Pycharm actually has a button that displays a log of all your code entries into your REPL. This is really handy in my experience as you can prototype code in the interpreter with working data/state, validate that it works right and then grab it from that window, copy it, and then paste it into a script/module to "graduate" it to more matured code.
That's what I could muster up off the top of my head. Pycharm in general has a ton of other nice things going for it, but ultimately, it is the really smooth REPL experience and how well integrated the shell is with the IDE that makes it my go-to IDE for anything Python.
Given what you've said, I think the interactive window can be iPython in VS Code. This may be a relatively recent development.
I'm not sure what I did to enable this, but it may be because I have the jupyter extension for VS code installed.
For instance:
- If I do `df.plot()`, I get a matplotlib image displayed directly in the interactive window
- Auto indentation works
- Tab completion works
- Commands like %load_ext autoreload work.
It sounds like the integration isn't as tight as with PyCharm. For example, you mention having ipython available in a debugging session. That's one thing that I haven't managed to get working in VS Code.
from IPython import embed; embed()
This will open iPython in the terminal window with the state of your program at the debug point loaded in. You do need to "quit()" it before moving on in the debugger though.