当前位置: 首页>>代码示例>>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;未经允许,请勿转载。