本文整理汇总了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()
示例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()
示例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()