I have a script in a laptop browser that does some real-time data analysis that I would like to run periodically once every few seconds / minutes, instead of having to do Ctrl + Enter all the time.
Is there any way to achieve this? Do I need additional plugins, and which ones
One way is to make your cell a function. In another cell, just call time.sleep () in the appropriate loop. You can also check if some external resource exists if you do not want to loop a priori a known finite number of times.
:
def periodic_work(interval): while True: #change this to the function you want to call, or paste in the code you want to run your_function() #interval should be an integer, the number of seconds to wait time.sleep(interval)
, periodic_work(60) - IPython, , Kernal . / , "" ( "" ) . , , periodic_work.
periodic_work(60)
periodic_work
Source: https://habr.com/ru/post/1544206/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1544201/passing-arrays-to-parameterized-junit&usg=ALkJrhihJOto1XrIDecgB4Hdqt6aLeY-lwWhy does the interpreter freeze when evaluating an expression? - pythonPHP mkdir - Why is this an invalid argument? - dateMoving a rectangle Java Swing leaves rectangles behind - javaRails paperclip and Amazon S3 'PermanentRedirect' - ruby-on-rails1048 Column value cannot be null - databaseGet python application version label deployed on elastic beanstalk - pythonREST API to login on Yii2 - restPython: getting out of several levels of the loop - pythonHow to configure a disconnect policy for Scala ExecutionContexts? - javaAll Articles