The more I think about it, the more it seems to me that we should always write the .py file next to the notebook. This would let more library-like uses of the code in a much easier workflow than now (where one must go through the download button, that puts the files in a different place, etc). Furthermore, by putting at the top:
script = __name__ == `__main__`
one could then write the 'script parts' of the notebook with
and the notebook could then be 'imported'. Since it would be a normal .py file, it would make it much easier to reuse code from one notebook to another via normal import mechanisms.
We may want later to consider other forms of cross-notebook referencing and loading, but I think that having out of the box mechanism to reuse notebooks as normal libraries would be extremely valuable.
@ellisonbg, @minrk, do you think it's easy to add a flag to do this automatically? I'd vote for having it always on, but I guess one could also want to turn it off, case in which it would need to be configurable. Ideally per-notebook, stored in the metadata, but initially it could be a server-level flag stored in the config file.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4