# Revision history [back]

I wrote a script to take a download_worksheets.zip file from the current directory and write the converted .ipynb files to the directory converted. It also prints the name of the temporary directory containing sagenb storage heirarchy. This directory needs to be deleted after the process is over. It would be nice if the script can be suitably modified to work with command line arguments and possibly with a directory of files rather than a .zip file.

import os
import zipfile
oldwd=os.getcwd()
ipd=oldwd+'/converted'
os.mkdir(ipd)

import tempfile
wd=tempfile.mkdtemp()
os.chdir(wd)
print(wd)

from sagenb_export.actions import action_print, action_convert_ipynb

nb.create_default_users('totallysecret')

for fl in zip_file.namelist():
zip_file.extract(fl)