I have a python file inside a zip archive which I want to run directly from a python notebook. Better yet, I'd prefer if I could import from it.
So far I have this:
import zipfile
with zipfile.ZipFile('archive.zip', mode='r') as zf:
with zf.open('code.py') as f:
# what now?
I suppose I could save the file somewhere then import from it. Maybe even using tempfile so I can clean up right away (hmm now that I try to implement tempfile, it doesn't feel so straight forward). But just wondering if I don't know what I don't know.