最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

post方法返回都是none

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

import web

? ? ? ??

urls = (

'/index','index',

'/blog/\d','blog',

? ? '/(.*)', 'hello'

)

app = web.application(urls, globals())


class index:

def GET(self):

query=web.input()

return query

class blog:

def POST(self):

data=web.input()

return data


class hello:? ? ? ??

? ? def GET(self, name):

? ? ? ? return open(r'new2.html').read()


if __name__ == "__main__":

? ? app.run()

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

<!DOCTYPE HTML>

<html><head meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>小型demo</title>

</head>

<body>

<h1>POST</h1>

<form action="/blog/123" method="POST">

<input type="text" name="id" value=""/>

<input type="password" name="password" value=""/>

<input type="submit" value="submit"/>

</form>

</body>

</html>

??

上面分別是html和python的源碼,網(wǎng)頁返回的都是none

正在回答

1 回答

那你在地址欄輸入的什么呢?

如果你輸入的是可以匹配上這個的'/blog/\d','blog',那么頁面可能會返回none;

如果想找到那個表單界面,只需要匹配?'/(.*)', 'hello',然后輸入用戶名密碼,提交后地址欄就會變成http://127.0.0.1:8080/blog/123,但是由于你上面寫的是\d,但是\d只能匹配上一個數(shù)字。。你可以試試改成\d+,或者吧html頁面的<form action="/blog/123" method="POST">改成<form action="/blog/1" method="POST">

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
python-web.py開發(fā)入門
  • 參與學(xué)習(xí)       58631    人
  • 解答問題       118    個

web.py開發(fā)入門入門教程,講解一個你最快能學(xué)會的web開發(fā)的框架

進(jìn)入課程

post方法返回都是none

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號