So with the following command it is possible to save the Jupyter Notebook:
Javascript('IPython.notebook.save_checkpoint();')
This works. However I want to save within a function. But the following doesn't seems to work:
def save_file():
Javascript('IPython.notebook.save_checkpoint();')
save_file()
Why is it not working?