omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Timer

    Pythonista
    4
    5
    2099
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • donnieh
      donnieh last edited by

      What is a simple way to have a timer call a function every 10 seconds?

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        It depends a little on what you're trying to do with it, is it in the context of a program with UI, or do you just print to the console?

        1 Reply Last reply Reply Quote 0
        • donnieh
          donnieh last edited by

          It will be used in a UI. Every 10 seconds I am going to call a function that a button on my UI also can call. (this is an auto feature in my app...)

                 #this gets called with a button tap, or automatically every 10 seconds by a timer
          
          1 Reply Last reply Reply Quote 0
          • reefboy1
            reefboy1 last edited by

            import time
            for x in range(1, 100):
               time.sleep(10.0)
               #commands
            
            1 Reply Last reply Reply Quote 0
            • ccc
              ccc last edited by

              See: https://github.com/cclauss/Pythonista_ui/blob/master/TimedRefreshView.py

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors