當前位置: 首頁>>代碼示例>>Python>>正文


Python application.application方法代碼示例

本文整理匯總了Python中application.application方法的典型用法代碼示例。如果您正苦於以下問題:Python application.application方法的具體用法?Python application.application怎麽用?Python application.application使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在application的用法示例。


在下文中一共展示了application.application方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: import application [as 別名]
# 或者: from application import application [as 別名]
def main():
    # debug|info|warning|error|none ????
    tornado.options.options.logging = "info"
    tornado.options.parse_command_line()
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start() 
開發者ID:xin1195,項目名稱:bcloud,代碼行數:9,代碼來源:server.py

示例2: main

# 需要導入模塊: import application [as 別名]
# 或者: from application import application [as 別名]
def main():
    tornado.options.parse_command_line()
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)

    print "Development server is running at http://127.0.0.1:%s" % options.port
    print "Quit the server with Control-C"

    tornado.ioloop.IOLoop.instance().start() 
開發者ID:saikumar2616,項目名稱:Python-from-basics,代碼行數:11,代碼來源:server.py

示例3: main

# 需要導入模塊: import application [as 別名]
# 或者: from application import application [as 別名]
def main():
    # deal Ctrl-C
    signal.signal(signal.SIGINT, signal_handler)

    tornado.options.parse_command_line()
    http_server = tornado.httpserver.HTTPServer(application)

    #?????
    http_server.listen(options.port)

    #???????(???????????)
    #http_server.bind(options.port)
    #http_server.start(0)

    #print 'Development server is running at http://127.0.0.1:%s/' % options.port
    #print 'Quit the server with Control-C'
    log.info('Development server is running at http://127.0.0.1:%s/' % options.port)
    log.info('Quit the server with Control-C')

    # nlpproc init
    nlp_global_obj = NlpProc()
    nlp_global_obj.init_nlpta()

    # datacenter init
    data_global_obj = DataCenter()
    data_global_obj.connect_db("127.0.0.1:3306",'testdb', 'root', 'password')

    # log in iflytek
    ifly_tek = IflyTek()

    # start get access token timer
    get_access_token_instance = WeixinClient()
    get_access_token_instance.get_access_token()   #get first time
    tornado.ioloop.PeriodicCallback(get_access_token_instance.get_access_token, period).start()  # start scheduler
    
    get_himalaya_access_token_ins = Himalaya()
    tornado.ioloop.PeriodicCallback(get_himalaya_access_token_ins.get_access_token, period).start()

    # test
    #tornado.ioloop.PeriodicCallback(like_cron, 10000).start()  # start scheduler

    # start tornado ioloop
    tornado.ioloop.IOLoop.instance().start() 
開發者ID:tianyongchina,項目名稱:wechat,代碼行數:45,代碼來源:server.py


注:本文中的application.application方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。