Skip to content
Advertisement

Is it possible to set a jupyter notebook chunk to run with a certain delay after the previous one?

I have the following 2 chunks. Once the first chunk gets executed in python it seems to me that it takes time for the stored procedure to execute in sql. Before that is done, however, python moves immediately to next chunk. Is it possible to delay running of the next chunk by say 5 minutes?

JavaScript
JavaScript

Advertisement

Answer

I’m not sure if Jupyter supports this directly, but you can just add time.sleep(n) as the first line in the block you want to have a delayed start. Here’s the reference.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement