I made a toy "literate programming" implementation made of markdown files with python code fences. IPython/Jupyter notebooks are the heavy-case, but this is 1000x simpler.
A very toy example: markdown (first), extracted python to run (second).
Enhancements:
I think it would be interesting to exec() the extracted code, but there's obviously some risk there. Another idea would be to copy the surrounding markdown into comments.
2 media files
@s0x0
You can hook into python's import machinery to do novelties like this
import markmodule
markmodule.import_md("hello_module.md")
import hello_module
print(hello_module.hello())
https://github.com/matthewdeanmartin/markmodule
GitHub - matthewdeanmartin/markmodule: Import python from markdown files.