by sdfghswe · 3y ago · 0 comments
The problem is Jupyter notebooks+Git.
The solution is use Jupyter, but not Jupyter notebooks.
If I said "the problem is now solved, just use VS Code", most people would say "but that's not jupyter, i need the interactivity aspect", not realizing that VS Code is just as interactive (thank to jupyter).
Jupyter notebooks is an interactive notebook that implements that protocol.
Do you know what also implements the protocol? VS Code. And doesn't have any of the stupid problems that the Jupyter notebooks do.
In VS Code if you do as below:
#%%
print("my python print")
#%%
Then you can run it as a cell. Crucially however, note that those delimiters are ALSO valid python code. So you just version as with everything else.