1
CMGS 2014-05-27 08:13:25 +08:00
抽出一个公共函数
|
3
cloverstd 2014-05-27 08:14:43 +08:00 via iPhone
用 httpclient 请求你要调用的 get
|
4
zhwei 2014-05-27 08:25:33 +08:00 via Android
直接重定向不行吗?
|
5
chenkun0128 2014-05-27 08:54:32 +08:00
|
6
wodemyworld 2014-05-27 08:58:40 +08:00
外包项目随便写,如果将来还得自己维护就少欠技术债,不然将来还得吃自己的屎
|
7
yibin001 OP @chenkun0128
谢谢。 |
8
stackpop 2014-05-27 09:33:01 +08:00
requests.get('/handlerURL')
|
9
taine 2014-05-27 10:04:00 +08:00
lz,问句题外话,程序中的handler中文名称是什么?处理器,还是处理程序?
|
12
latyas 2015-07-14 11:03:30 +08:00 1
from tornado.web import Application, RequestHandler
from tornado.ioloop import IOLoop from functools import partial class FuckinHandler(RequestHandler): def get(self): func = partial(Handler.get.im_func, self) func() class Handler(RequestHandler): def get(self): self.write('test') self.finish() WEBSERVER_PORT = 10000 application = Application([ (r'/', FuckinHandler), ]) application.listen(WEBSERVER_PORT) IOLoop.instance().start() |