Auto reloading jupter notebook when file changed on disk

Viewed 819

I'd like to edit jupyter notebooks using an IDE (pycharm) for the autocomplete functionality. But pycharm isn't very good at executing / previewing the results, so I'd like to keep the notebook open in the browser and automatically reload whenever the file changes on disk.

Ideal workflow:

  • Edit code in Pycharm
  • Automatically see updated code in browser and hit ctrl + enter to see output

Current workflow:

  • Edit code in Pycharm
  • Manually hit refresh in browser, sometimes see a browser warning and have to click a confirmation to reload, then see changes and hit ctrl + enter

I've tried:

#%load_ext autoreload
#%autoreload 2

but it doesn't seem to do much.

Sometimes the browser detects that the file has changed (usually several seconds after its changed), but I then have to click two seperate confirmation dialogs to actually refresh the page.

Any ideas how it could just reload automatically whenever it changes on disc?

1 Answers
Related