对python的手册真的很无语

ImN1 2013-01-12 06:35:11
python3.3手册HTMLParser一节居然没写支持 unescape(),只列在SAX一节
还是google到别人这样用才晓得
灰常有用的函数啊


>>> import html.parser
>>> h = html.parser.HTMLParser()
>>> s = h.unescape('© 2010')
>>> s
u'\xa9 2010'
>>> print s
© 2010
>>> s = h.unescape('© 2010')
>>> s
u'\xa9 2010'

>>> '袈'.encode("unicode-escape")
b'\\u8888'
>>> chr(int('8888', 16))
'袈'

>>> h.unescape('♥')
'♥'
>>> h.unescape('♥')
'♥'
>>> h.unescape('♥')
'♥'
>>> '♥'.encode("unicode-escape")
b'\\u2665'
>>> chr(int('2665', 16))
'♥'

>>> import html.entities as h
>>> h.name2codepoint['hearts']
9829
...全文
406 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
bugs2k 2013-01-15
  • 打赏
  • 举报
回复
引用 11 楼 snmr_com 的回复:
引用 10 楼 bugs2k 的回复:ZipFile.infolist() Return a list containing a ZipInfo object for each member of the archive. The objects are in the same order as their entries in the actual ZIP file……
这个也是python手册上的
ImN1 2013-01-15
  • 打赏
  • 举报
回复
引用 10 楼 bugs2k 的回复:
ZipFile.infolist() Return a list containing a ZipInfo object for each member of the archive. The objects are in the same order as their entries in the actual ZIP file on disk if an exis……
文根英你太睏了吧,怎么回贴到这里来了?
bugs2k 2013-01-14
  • 打赏
  • 举报
回复
ZipFile.infolist() Return a list containing a ZipInfo object for each member of the archive. The objects are in the same order as their entries in the actual ZIP file on disk if an existing archive was opened. ZipFile.namelist() Return a list of archive members by name. 貌似应该是打开的zipfile对象函数
ChongQingJin28 2013-01-14
  • 打赏
  • 举报
回复
谢谢楼上的回复。
我真的不知道还有这样的例子。

但是:

不是有个词叫自主创新吗?咱们做不到创新,咱自主创造总可以的吧!
例子有了,可以不用写了,建个小UI,快速的得到例子总是可以的吧!

可以将UI整合进eclipse里,会是一个多好的templete呀!!
libralibra 2013-01-14
  • 打赏
  • 举报
回复
引用 2 楼 zhouchongzxc 的回复:
要不咱们建立一个小组,修改一下python的官方doc。 并不是翻译成中文,而是增加一些小例子,另外用tk或wx建一个UI。用UI来搜索、查看示例代码。把chm浏览器替换掉。 觉得怎么样呢? 有人愿意吗??
有一个很有名的blog,弄了个专题叫PyMOTW: Python Module of the Week http://www.doughellmann.com/PyMOTW/
sanhan 2013-01-13
  • 打赏
  • 举报
回复
这个。。。去加盟python.org好了。
晓渡 2013-01-13
  • 打赏
  • 举报
回复
引用 2 楼 zhouchongzxc 的回复:
要不咱们建立一个小组,修改一下python的官方doc。 并不是翻译成中文,而是增加一些小例子,另外用tk或wx建一个UI。用UI来搜索、查看示例代码。把chm浏览器替换掉。 觉得怎么样呢? 有人愿意吗??
ChongQingJin28 2013-01-12
  • 打赏
  • 举报
回复
翻译就没有必要了吧。我想要的是增加。
我认为的是,每个程序员都应该有自己的doc。
(没有多难的吧,根据一个class写几个小例子比根据python doc写几个例子应该简单的多了吧)
(如果有人愿意的话,那就算我一个。如果没有人愿意,我就继续增加我的info(elisp) )
ImN1 2013-01-12
  • 打赏
  • 举报
回复
这个挺难的,而且有前人正在做这事,你可以加入他们的小组 http://code.google.com/p/python-doc-translation/
引用 2 楼 zhouchongzxc 的回复:
要不咱们建立一个小组,修改一下python的官方doc。 并不是翻译成中文,而是增加一些小例子,另外用tk或wx建一个UI。用UI来搜索、查看示例代码。把chm浏览器替换掉。 觉得怎么样呢? 有人愿意吗??
bugs2k 2013-01-12
  • 打赏
  • 举报
回复
ChongQingJin28 2013-01-12
  • 打赏
  • 举报
回复
要不咱们建立一个小组,修改一下python的官方doc。

并不是翻译成中文,而是增加一些小例子,另外用tk或wx建一个UI。用UI来搜索、查看示例代码。把chm浏览器替换掉。

觉得怎么样呢? 有人愿意吗??
tkminigame 2013-01-12
  • 打赏
  • 举报
回复
同样对手册表示无语的路过,检索不方便,函数描述没有固定的格式,找东西麻烦。 最有用的可能就是入门教程,经常去里面找东西。

37,721

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧