是否可以将 jupyter notebook 块设置为 运行 并在前一个之后有一定的延迟?
Is it possible to set a jupyter notebook chunk to run with a certain delay after the previous one?
我有以下 2 个块。一旦第一个块在 python 中执行,在我看来,存储过程在 sql 中执行需要时间。然而,在此之前,python 立即移动到下一个块。是否可以将下一个块的 运行 延迟 5 分钟?
gmd_connection.autocommit=True
# create cursor
cursor = gmd_connection.cursor()
query='EXEC sm.spSecuritiesCreate'
cursor.execute(query)
# close cursor
cursor.close()
# create cursor
cursor = gmd_connection.cursor()
query='EXEC sm.spSolsteinSecuritiesMap'
cursor.execute(query)
# close cursor
cursor.close()
#close connection
gmd_connection.close()
我不确定 Jupyter 是否直接支持此功能,但您可以将 time.sleep(n)
添加为要延迟启动的块中的第一行。 Here's the reference.
我有以下 2 个块。一旦第一个块在 python 中执行,在我看来,存储过程在 sql 中执行需要时间。然而,在此之前,python 立即移动到下一个块。是否可以将下一个块的 运行 延迟 5 分钟?
gmd_connection.autocommit=True
# create cursor
cursor = gmd_connection.cursor()
query='EXEC sm.spSecuritiesCreate'
cursor.execute(query)
# close cursor
cursor.close()
# create cursor
cursor = gmd_connection.cursor()
query='EXEC sm.spSolsteinSecuritiesMap'
cursor.execute(query)
# close cursor
cursor.close()
#close connection
gmd_connection.close()
我不确定 Jupyter 是否直接支持此功能,但您可以将 time.sleep(n)
添加为要延迟启动的块中的第一行。 Here's the reference.