本文整理匯總了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()