I’d like to be able to export the contents of some cells programmatically, but before doing so I’d like to check if the cell would run as a standalone python module/file.
Is there a way of quickly executing a cell via the API in a blank/fresh context to check if it would run by itself?
The manual version of this process for reference is to copy the contents of a cell into a new python file, then run it with python newfile.py
and eliminate the NameErrors one by one.