Home > database >  Run parts of Python code in visual studio code like with R
Run parts of Python code in visual studio code like with R

Time:02-16

So I am trying to wean myself of R a bit more where using this keyboard combination:

CTRL   Enter

allows me to run parts of the code repeatedly (i.e. data frames etc. stay in memory) bit like in a notebook. For Python I can use:

CTRL   F5

to run all code or:

SHIFT   Enter 

to run code selection but I cannot run code repeatedly like in R (i.e. objects stay in memory)? Am I right? I wish that I am not haha. Any pointer very much appreciated! Thanks!

PS:

Related (?) discussion:

Python IDLE equivalent of CTRL-R in R

CodePudding user response:

I don't know if I completely understand the question. But vsCode does support python notebooks. You can download a Extension called Jupyter to use it in VsCode. After downloading it you can open a .ipynb file to open the notebook inside VsCode. There is also online python notebook from Google at colab.research.google.com.

You can also download Anaconda and use the Jupyter Notebook that comes with it, as it also supports R. (see: docs)

  • Related