2005年04月20日 星期三 10:35
Wang Kebo 写道: >只写你需要的就可以了。 > >__ >Best Regards, > >Kebo Wang > > > > >>-----Original Message----- >>From: python-chinese-bounces at lists.python.cn >>[mailto:python-chinese-bounces at lists.python.cn] On Behalf Of 清风 >>Sent: Wednesday, April 20, 2005 9:44 AM >>To: python-chinese at lists.python.cn >>Subject: [python-chinese] Cherrypy必须在参数中写下所有的表单项目吗? >> >>例如我的表单有4项(比如有两个文本框,两个下拉框),但只想用两个文本框的 >>内容,是否也必须在参数中写所有表单的内容? >> >>urlimage(self,shirt,imgurl,myfile,imgfrom): >> >>像上面就是都写下了,可否只写需要的参数?像提交按钮如果也有name值,那么他 >>也要我提供,晕。 >> >>_______________________________________________ >>python-chinese list >>python-chinese at lists.python.cn >>http://python.cn/mailman/listinfo/python-chinese >> >> >> 可是报错。。。 TypeError: urlimage() got an unexpected keyword argument 'imgform'
2005年04月21日 星期四 09:11
Hi!
我最近从perl 转到 python, 有个这个问题:
例如这行perl代码: $HTML =~ s/\$(\w+)/${$1}/g;
其工作原理是这样的:$HTML是一个字符串,包含了一个 html文件的内容。正则表
达式搜索以“$”开头的变量名,“\w”表示字符(a-z,A-Z,0-9 或下划线),“+”意味着
一个或多个字符。“\w+”两边的括号表示要把匹配的变量名存到“$1”中,最后,
“${$1}”计算出变量的值。
如
$name="test"
$HTML="...$name ...."
执行这句后: $HTML =~ s/\$(\w+)/${$1}/g;
$HTML的值就变为了: "...test ....."
Regards
Falls Huang
2005年04月21日 星期四 09:27
清风 写道: >Wang Kebo 写道: > > > >>只写你需要的就可以了。 >> >>__ >>Best Regards, >> >>Kebo Wang >> >> >> >> >> >> >>>-----Original Message----- >>>From: python-chinese-bounces at lists.python.cn >>>[mailto:python-chinese-bounces at lists.python.cn] On Behalf Of 清风 >>>Sent: Wednesday, April 20, 2005 9:44 AM >>>To: python-chinese at lists.python.cn >>>Subject: [python-chinese] Cherrypy必须在参数中写下所有的表单项目吗? >>> >>>例如我的表单有4项(比如有两个文本框,两个下拉框),但只想用两个文本框的 >>>内容,是否也必须在参数中写所有表单的内容? >>> >>>urlimage(self,shirt,imgurl,myfile,imgfrom): >>> >>>像上面就是都写下了,可否只写需要的参数?像提交按钮如果也有name值,那么他 >>>也要我提供,晕。 >>> >>>_______________________________________________ >>>python-chinese list >>>python-chinese at lists.python.cn >>>http://python.cn/mailman/listinfo/python-chinese >>> >>> >>> >>> >>> >可是报错。。。 > >TypeError: urlimage() got an unexpected keyword argument 'imgform' > > > >_______________________________________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese > > > > 这个是我在mail敲错了,我仔细检查了,在htm中确实是imgfrom,而在表单中要提 交的方法中如果没有imgfrom,那么会报错 Traceback (most recent call last): File "D:\PYTHON23\Lib\site-packages\cherrypy\_cphttptools.py", line 206, in doRequest handleRequest(wfile) File "D:\PYTHON23\Lib\site-packages\cherrypy\_cphttptools.py", line 389, in handleRequest body = func(*(virtualPathList + cpg.request.paramList), **(cpg.request.paramMap)) TypeError: urlimage() got an unexpected keyword argument 'imgfrom' 用*arg也不行。。。晕死
2005年04月21日 星期四 09:30
vars = {'name':'test'}
HTML = "...%(name)s ..."
out = HTML % vars_
print out
Falls Huang 写道:
>Hi!
> 我最近从perl 转到 python, 有个这个问题:
> 例如这行perl代码: $HTML =~ s/\$(\w+)/${$1}/g;
>
>其工作原理是这样的:$HTML是一个字符串,包含了一个 html文件的内容。正则表
>达式搜索以“$”开头的变量名,“\w”表示字符(a-z,A-Z,0-9 或下划线),“+”意味着
>一个或多个字符。“\w+”两边的括号表示要把匹配的变量名存到“$1”中,最后,
>“${$1}”计算出变量的值。
>
>如
>$name="test"
>$HTML="...$name ...."
>执行这句后: $HTML =~ s/\$(\w+)/${$1}/g;
>$HTML的值就变为了: "...test ....."
>
>Regards
>Falls Huang
>
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>
>
>
>
2005年04月21日 星期四 10:11
ÎÒ²éÁËËùÓÐStyledTextCtrl Àý×Ó£¬¶ÔÓÚÓï·¨ÏÔʾÕý³££¬µ«¶¼Ã»ÓжÔÓÚ³ÌÐò×Ô¶¯Ëõ½ø£¬ ±ÈÈç¶ÔÓÚpython³ÌÐò£¬Ã¿Ðлسµºó£¬µ½ÏÂÒ»Ðж¼ÊÇ×ʼλÖã¬Èç¹û±à¼³ÌÐò£¬ºÜ²»·½±ã¡£ ÇëÎÊÓÐûÓа취£¿ лл¡£ ----------------------------------------------- Best regards, kangzz mailto:zzhikang at hotmail.com Tel : 021-65407754 MP: 13916928084 _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
2005年04月21日 星期四 13:02
这个要自已实现。NewEdit就是自已做到这一点的。 在05-4-21,kanchy kang<zzhikang at hotmail.com> 写道: > 我查了所有StyledTextCtrl 例子,对于语法显示正常,但都没有对于程序自动缩进, > 比如对于python程序,每行回车后,到下一行都是最开始位置,如果编辑程序,很不方便。 > > 请问有没有办法? > 谢谢。 > > ----------------------------------------------- > Best regards, > kangzz > > mailto:zzhikang at hotmail.com > Tel : 021-65407754 > MP: 13916928084 > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > -- I like python! My Donews Blog: http://www.donews.net/limodou My Sina Blog: http://blog.sina.com.cn/blog/1148608914 New Google Maillist: http://groups-beta.google.com/group/python-cn
Zeuux © 2025
京ICP备05028076号