Use vi for .py and then convert to .ipynb

There are many solutions on the web. But if I really want to use my favourite editor vi to edit a .py file
(with all the vi tricks) but still want to have the options to convert to .ipynb so I can see results in various cells, is there a consistent way of doing that?

If I put everything in .py then it seems I am using a single cell concept in the .ipynb language.

I believe there’s an entire section on the formatting you can provide when writing your .py file spelled out in the Jupytext documentation, Notebooks as scripts. You probably want to look at the ‘percent format’ or the ‘light format’.

formightez: You are always very helpful and resourceful. I will have to study it in detail later. Cheers!