[Python] 纯文本查看 复制代码#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web
import re
urls =(
'/','Index',
)
class Index:
def GET(self):
i= web.input()#获取请求的参数
return i.get('echostr')
return 'hello world!'
def POST(self):
i=web.data()
print i
reg = '''
(.*?)
(.*?)'''
ToUserName,FromUserName,CreateTime,Content,MsgId=re.findall(reg,i)[0]
return '''
%s
'''%(FromUserName,ToUserName,CreateTime,Content)
print( ToUserName,FromUserName,CreateTime,Content,MsgId)
if __name__ == '__main__':
web.application(urls,globals()).run()