save a juptyer notebook with specific name within

2019-07-21 10:57发布

I have a Jupyter notebook that is more or a less a 'template' of how things are done. For example the notebook is a template of say each country's economic data. All of the plots, and analysis is standardized.

I'm looking for a way to have this saving done in a coded way rather than manually naming it myself. Is there anyway so that if I have a variable labeled as:

  my_assignment = 'india'

I could save the notebook name as

  file_name =   my_assignment + todays_date

 save(file_name)

I code in python.

1条回答
我命由我不由天
2楼-- · 2019-07-21 11:26

You may have to jump to %%javascript to interact with Jupyter, which is different to the ipython kernel that the python code is sent to, e.g.:

%%javascript
Jupyter.notebook.copy_notebook()

Not sure you can copy with a specific name.
You can programmaticly rename the current notebook with:

Jupyter.notebook.rename(<new_name>)
查看更多
登录 后发表回答