# encoding: utf-8
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
#reload(sys)
import importlib
importlib.reload(sys)
import web
urls = (
'/','index',
'/test/(.+)/(.+)','test',
'/test','test'
)
class index:
def GET(self):
return "hello world!"
class test:
# def GET(self,name,pwd):
# print(name,pwd)
# web.header('Content-Type', 'text/html;charset=UTF-8')
# return "test-----name:{0}-------pwd:{1}".format(name,pwd)
def POST(self):
webData = web.input()
name = webData.get("name")
pwd = webData.get("pwd")
arrays = name.split(',')
print(arrays)
print(pwd)
return webData
if __name__ == '__main__':
app = web.application(urls,globals())
app.run()
python完成一个简易的web应用
最新推荐文章于 2024-05-10 09:37:36 发布