Using # %% in VS Code to make Python Files act like Notebooks
First of all, thanks to for letting us know how to execute portions of Python programs via Shift-Enter to run a portion of a Python program in a Jupyter Notebooks way. (see Alchemy Codex course, section Code Editor Configuration). This is truly a very handy way to run Python programs in an experimental or incremental way. However, there is another approach to accomplishing this functionality. You can split your program into Jupyter like code cells by separating them with a marker of:
# %% Description
By starting a line with "# %%" you can effectively turn a Python program in VS Code into a Jupyter notebook. [Note: you do have to have Jupyter installed via Anacoda or pip to make this happen.]
Please see the official documentation on the Visual Studio Code website with this link:
Please post any questions and I will attempt to help you get this to work.
4
0 comments
Paul Low
3
Using # %% in VS Code to make Python Files act like Notebooks
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
powered by