2007年11月21日 星期三 16:28
import sys
import web
urls = ('/', 'index')
class index:
def GET(self):
print dir(self)
#web.webapi.internalerror = web.debugerror
##########################
if __name__ == '__main__':
web.run(urls, globals())
这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢?
谢谢!
--
LinuX Power
2007年11月21日 星期三 16:38
·Ö±ð¶ÔÓ¦¶ÔÏóÖеÄGETÓëPOST
class A:
def GET(slef):
...
def POST(slef):
...
On Nov 21, 2007 4:28 PM, Marco <marco在waven.com> wrote:
> import sys
> import web
>
> urls = ('/', 'index')
>
> class index:
> def GET(self):
> print dir(self)
>
> #web.webapi.internalerror = web.debugerror
> ##########################
> if __name__ == '__main__':
> web.run(urls, globals())
>
>
> ÕâÊÇweb.pyÉϵÄÀý×Ó£¬ ÇëÎÊ£¬ ÈçºÎ²ÅÄÜ´¦Àíä¯ÀÀÆ÷·¢À´µÄÊý¾Ý(http GET/POSTµÄ²ÎÊý)ÄØ£¿
>
> лл£¡
>
> --
> LinuX Power
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
--
×îºÃµÄÍÆ¹ã±ãÊÇʵ¼ÊÓ¦ÓÃ
×î½üÔÚѧϰweb.py, ¼á³Ö²ÅÄܽø²½
http://del.icio.us/iexper
http://twitter.com/qichangxing
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071121/2f0b13d5/attachment.htm
2007年11月21日 星期三 16:40
class A:
def GET(self, id, name):
...
id, name, ¾ÍÊÇget·¢Ë͹ýÀ´µÄ
On Nov 21, 2007 4:38 PM, ´óÀÉ <iexper在gmail.com> wrote:
>
> ·Ö±ð¶ÔÓ¦¶ÔÏóÖеÄGETÓëPOST
>
> class A:
> def GET(slef):
> ...
>
> def POST(slef):
> ...
>
>
> On Nov 21, 2007 4:28 PM, Marco <marco在waven.com > wrote:
>
> > import sys
> > import web
> >
> > urls = ('/', 'index')
> >
> > class index:
> > def GET(self):
> > print dir(self)
> >
> > #web.webapi.internalerror = web.debugerror
> > ##########################
> > if __name__ == '__main__':
> > web.run(urls, globals())
> >
> >
> > ÕâÊÇweb.pyÉϵÄÀý×Ó£¬ ÇëÎÊ£¬ ÈçºÎ²ÅÄÜ´¦Àíä¯ÀÀÆ÷·¢À´µÄÊý¾Ý(http GET/POSTµÄ²ÎÊý)ÄØ£¿
> >
> > лл£¡
> >
> > --
> > LinuX Power
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
>
> --
> ×îºÃµÄÍÆ¹ã±ãÊÇʵ¼ÊÓ¦ÓÃ
> ×î½üÔÚѧϰweb.py, ¼á³Ö²ÅÄܽø²½
> http://del.icio.us/iexper
> http://twitter.com/qichangxing
> Gtalk: iexper(at)gmail.com
--
×îºÃµÄÍÆ¹ã±ãÊÇʵ¼ÊÓ¦ÓÃ
×î½üÔÚѧϰweb.py, ¼á³Ö²ÅÄܽø²½
http://del.icio.us/iexper
http://twitter.com/qichangxing
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071121/6b929309/attachment.html
2007年11月21日 星期三 16:51
喔, 谢谢!! On 11/21/07, 大郎 <iexper在gmail.com> wrote: > class A: > def GET(self, id, name): > ... > id, name, 就是get发送过来的 > > On Nov 21, 2007 4:38 PM, 大郎 <iexper在gmail.com> wrote: > > > > > 分别对应对象中的GET与POST > > > > class A: > > def GET(slef): > > ... > > > > def POST(slef): > > ... > > > > > > On Nov 21, 2007 4:28 PM, Marco <marco在waven.com > wrote: > > > > > import sys > > > import web > > > > > > urls = ('/', 'index') > > > > > > class index: > > > def GET(self): > > > print dir(self) > > > > > > #web.webapi.internalerror = web.debugerror > > > ########################## > > > if __name__ == '__main__': > > > web.run(urls, globals()) > > > > > > > > > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢? > > > > > > 谢谢! > > > > > > -- > > > LinuX Power > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > -- > > 最好的推广便是实际应用 > > 最近在学习web.py, 坚持才能进步 > > http://del.icio.us/iexper > > http://twitter.com/qichangxing > > Gtalk: iexper(at)gmail.com > > > > > -- > 最好的推广便是实际应用 > 最近在学习web.py, 坚持才能进步 > http://del.icio.us/iexper > http://twitter.com/qichangxing > Gtalk: iexper(at)gmail.com > -- LinuX Power
2007年11月21日 星期三 16:58
好像不行……
Traceback (most recent call last):
File "/var/lib/python-support/python2.4/web/webapi.py", line 304, in wsgifunc
result = func()
File "/var/lib/python-support/python2.4/web/request.py", line 131, in
func = lambda: handle(inp, fvars)
File "/var/lib/python-support/python2.4/web/request.py", line 61, in handle
return tocall(*([x and urllib.unquote(x) for x in args] + fna))
TypeError: GET() takes exactly 3 arguments (1 given)
On 11/21/07, Marco <marco在waven.com> wrote:
> 喔, 谢谢!!
>
> On 11/21/07, 大郎 <iexper在gmail.com> wrote:
> > class A:
> > def GET(self, id, name):
> > ...
> > id, name, 就是get发送过来的
> >
> > On Nov 21, 2007 4:38 PM, 大郎 <iexper在gmail.com> wrote:
> >
> > >
> > > 分别对应对象中的GET与POST
> > >
> > > class A:
> > > def GET(slef):
> > > ...
> > >
> > > def POST(slef):
> > > ...
> > >
> > >
> > > On Nov 21, 2007 4:28 PM, Marco <marco在waven.com > wrote:
> > >
> > > > import sys
> > > > import web
> > > >
> > > > urls = ('/', 'index')
> > > >
> > > > class index:
> > > > def GET(self):
> > > > print dir(self)
> > > >
> > > > #web.webapi.internalerror = web.debugerror
> > > > ##########################
> > > > if __name__ == '__main__':
> > > > web.run(urls, globals())
> > > >
> > > >
> > > > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢?
> > > >
> > > > 谢谢!
> > > >
> > > > --
> > > > LinuX Power
> > > > _______________________________________________
> > > > python-chinese
> > > > Post: send python-chinese在lists.python.cn
> > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > > Unsubscribe: send unsubscribe to
> python-chinese-request在lists.python.cn
> > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> > >
> > >
> > > --
> > > 最好的推广便是实际应用
> > > 最近在学习web.py, 坚持才能进步
> > > http://del.icio.us/iexper
> > > http://twitter.com/qichangxing
> > > Gtalk: iexper(at)gmail.com
> >
> >
> >
> >
> > --
> > 最好的推广便是实际应用
> > 最近在学习web.py, 坚持才能进步
> > http://del.icio.us/iexper
> > http://twitter.com/qichangxing
> > Gtalk: iexper(at)gmail.com
> >
>
>
> --
> LinuX Power
>
--
LinuX Power
2007年11月21日 星期三 17:00
好! 我再看看, 谢谢! On 11/21/07, Marco <marco在waven.com> wrote: > 好像不行…… > > Traceback (most recent call last): > File "/var/lib/python-support/python2.4/web/webapi.py", line 304, in > wsgifunc > result = func() > File "/var/lib/python-support/python2.4/web/request.py", line 131, in >> func = lambda: handle(inp, fvars) > File "/var/lib/python-support/python2.4/web/request.py", line 61, in > handle > return tocall(*([x and urllib.unquote(x) for x in args] + fna)) > TypeError: GET() takes exactly 3 arguments (1 given) > > > On 11/21/07, Marco <marco在waven.com> wrote: > > 喔, 谢谢!! > > > > On 11/21/07, 大郎 <iexper在gmail.com> wrote: > > > class A: > > > def GET(self, id, name): > > > ... > > > id, name, 就是get发送过来的 > > > > > > On Nov 21, 2007 4:38 PM, 大郎 <iexper在gmail.com> wrote: > > > > > > > > > > > 分别对应对象中的GET与POST > > > > > > > > class A: > > > > def GET(slef): > > > > ... > > > > > > > > def POST(slef): > > > > ... > > > > > > > > > > > > On Nov 21, 2007 4:28 PM, Marco <marco在waven.com > wrote: > > > > > > > > > import sys > > > > > import web > > > > > > > > > > urls = ('/', 'index') > > > > > > > > > > class index: > > > > > def GET(self): > > > > > print dir(self) > > > > > > > > > > #web.webapi.internalerror = web.debugerror > > > > > ########################## > > > > > if __name__ == '__main__': > > > > > web.run(urls, globals()) > > > > > > > > > > > > > > > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢? > > > > > > > > > > 谢谢! > > > > > > > > > > -- > > > > > LinuX Power > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese在lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > -- > > > > 最好的推广便是实际应用 > > > > 最近在学习web.py, 坚持才能进步 > > > > http://del.icio.us/iexper > > > > http://twitter.com/qichangxing > > > > Gtalk: iexper(at)gmail.com > > > > > > > > > > > > > > > -- > > > 最好的推广便是实际应用 > > > 最近在学习web.py, 坚持才能进步 > > > http://del.icio.us/iexper > > > http://twitter.com/qichangxing > > > Gtalk: iexper(at)gmail.com > > > > > > > > > -- > > LinuX Power > > > > > -- > LinuX Power > -- LinuX Power
2007年11月21日 星期三 17:10
On Nov 21, 2007 4:28 PM, Marco <marco在waven.com> wrote: > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢? web.input() -- Qiangning Hong http://www.douban.com/people/hongqn/
2007年11月21日 星期三 17:17
On Nov 21, 2007 4:28 PM, Marco <marco在waven.com> wrote: > import sys > import web > ... > > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢? input函数是你需要的东西: input(*requireds, **defaults) Returns a `storage` object with the GET and POST arguments. See `storify` for how `requireds` and `defaults` work. 例如: i = web.input() print i.username, i.password
2007年11月21日 星期三 17:28
你们是不是都看过web.py的源代码? 不要怎么会知道文档上没有的东西? On 11/21/07, Qiangning Hong <hongqn在gmail.com> wrote: > On Nov 21, 2007 4:28 PM, Marco <marco在waven.com> wrote: > > 这是web.py上的例子, 请问, 如何才能处理浏览器发来的数据(http GET/POST的参数)呢? > > web.input() > > > -- > Qiangning Hong > http://www.douban.com/people/hongqn/ > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- LinuX Power
Zeuux © 2025
京ICP备05028076号