In [13]:
import tornado
import chronos 

import os
import urllib

In [14]:
help(chronos)
chronos.setup()


Help on package chronos:

NAME
    chronos

PACKAGE CONTENTS
    chronos
    setup

FILE
    (built-in)


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-c8bfa7943fbc> in <module>()
      1 help(chronos)
----> 2 chronos.setup()

AttributeError: module 'chronos' has no attribute 'setup'

In [4]:
def test_process():
    print("process pid %s" % (os.getpid()))


def test(word):
    print("an other task, say '%s'" % (word))


def say():
    #response = urllib2.urlopen('https://www.google.com/')
    #html = response.read()
    #print(html[:10])
    print("say hello")

def init():
    # bind a ioloop or use default ioloop
    
    chronos.setup()  # chronos.setup(tornado.ioloop.IOLoop())
    chronos.schedule('say', chronos.every_second(1), say)
    chronos.schedule('say2', chronos.every_second(1), test_process, once=True, process=True)
    chronos.schedule('say3', chronos.every_second(1), lambda: test("test3"))
    chronos.start(True)

if __name__ == '__main__':
    init()


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-1db89ac43ce6> in <module>()
     22 
     23 if __name__ == '__main__':
---> 24     init()

<ipython-input-4-1db89ac43ce6> in init()
     15 def init():
     16     # bind a ioloop or use default ioloop
---> 17     chronos.setup()  # chronos.setup(tornado.ioloop.IOLoop())
     18     chronos.schedule('say', chronos.every_second(1), say)
     19     chronos.schedule('say2', chronos.every_second(1), test_process, once=True, process=True)

AttributeError: module 'chronos' has no attribute 'setup'

In [ ]: