??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产久精国产,久久精品国产99久久久古代,久久婷婷人人澡人人爽人人爱http://www.shnenglu.com/Hero/category/11347.html 一D|q封存的记忆Q随风而去zh-cnSat, 15 Aug 2009 03:53:03 GMTSat, 15 Aug 2009 03:53:03 GMT60POI_1http://www.shnenglu.com/Hero/archive/2009/08/05/92266.htmlHeroHeroWed, 05 Aug 2009 03:33:00 GMThttp://www.shnenglu.com/Hero/archive/2009/08/05/92266.htmlhttp://www.shnenglu.com/Hero/comments/92266.htmlhttp://www.shnenglu.com/Hero/archive/2009/08/05/92266.html#Feedback0http://www.shnenglu.com/Hero/comments/commentRss/92266.htmlhttp://www.shnenglu.com/Hero/services/trackbacks/92266.html1 //Hiro POI_1 accepted  0.04         3.7M  PYTH  
2 
3 while 1 :
4     a = input()
5    if (int)(a) == 42 :
6         break ;
7    print(a) ;
8           
9 

Hero 2009-08-05 11:33 发表评论
]]>
常用的Python?/title><link>http://www.shnenglu.com/Hero/archive/2009/07/29/91582.html</link><dc:creator>Hero</dc:creator><author>Hero</author><pubDate>Wed, 29 Jul 2009 06:01:00 GMT</pubDate><guid>http://www.shnenglu.com/Hero/archive/2009/07/29/91582.html</guid><wfw:comment>http://www.shnenglu.com/Hero/comments/91582.html</wfw:comment><comments>http://www.shnenglu.com/Hero/archive/2009/07/29/91582.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Hero/comments/commentRss/91582.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Hero/services/trackbacks/91582.html</trackback:ping><description><![CDATA[<fieldset>        Tkinter———?Python默认的图形界面接口?br>  Tkinter是一个和Tk接口的Python模块QTkinter库提供了对Tk API的接口,它属于Tcl/Tk的GUI工具l。Tcl/Tk是由John Ousterhout发展的书写和囑Ş讑֤。Tcl(工具命o语言)是个宏语aQ用于简化shell下复杂程序的开发,Tk工具包是和Tcl一起开发的Q目的是Z化用h口的设计q程。Tk工具包由许多不同的小部gQ如一个按钮、一个滚动条{。通过Tk提供的这些小部gQ我们就可快速地q行GUI开发。Perl、Scheme{语a也利用Tk库进行GUI开发。Tkinter是跨q_Q在各种q_下都能用?br>  Python Imaging Library(PIL)————python提供强大的图形处理的能力Qƈ提供q泛的图形文件格式支持,该库能进行图形格式的转换、打印和昄。还能进行一些图形效果的处理Q如囑Ş的放大、羃?yu)和旋{{。是Python用户q行图象处理的强有力工具?br>  Pmw(Python megawidgets)PythonGUIlg集————一个在python中利用Tkinter模块构徏的高UGUIlgQ每个Pmw都合q了一个或多个TkinterlgQ以实现更有用和更复杂的功能?br>  PyXML———?用Python解析和处理XML文档的工具包Q包中的4DOM是完全相容于W3C DOM规范的。它包含以下内容Q?br>  xmlproc: 一个符合规范的XML解析器?br>  Expat: 一个快速的Q非验证的XML解析器?q有其他<br>  和他同别的q有 PyHtml PySGML<br>  PyGame———?用于多媒体开发和游戏软g开发的模块?br>  PyOpenGL———?模块装?#8220;OpenGL应用E序~程接口”Q通过该模块pythonE序员可在程序中集成2D?D的图形?br>  NumPy、NumArray和SAGE———?NumArray是Python的一个扩展库Q主要用于处理Q意维数的固定cd数组Q简单说是一个矩阵库。它的低层代码用C来编写,所以速度的优势很明显。NumPy是Numarray的后l者,用来代替NumArray。SAGE是基于NumPy和其他几个工h整合成的数学软g包,目标是取?Magma, Maple, Mathematica和Matlab q类工具?br>  MySQLdb模块———?用于q接MySQL数据库。还有用于zope的ZMySQLDA模块Q通过它就可在zope中连接mysql数据库?br>  PyGTK ———?用于python GUIE序开发的GTK+库。GTK是用来实现GIMP和Gnome的那个库。有了它Q你完全可以自信的尝试自己制造Photoshop<br>  PyQt ———?用于python的Qt开发库。QT是实现了KDE环境的那个库Q由一pd的模块组成,有qt, qtcanvas, qtgl, qtnetwork, qtsql, qttable, qtui and qtxmlQ包含有300个类和超q?750个的函数和方法。PyQtq支持一个叫qtext的模块,它包含一个QScintilla库。该库是 Scintillar~辑器类的Qt接口?br>  PyMedia ———?用于多媒体操作的python模块。它提供了丰富而简单的接口用于多媒体处?wav, mp3, ogg, avi, divx, dvd, cdda etc)。可在Windows和Linuxq_下用?br>  Psyco ———?一个Python代码加速度器,可Python代码的执行速度提高C~译语言一L水^?br>  Python-ldap ———?提供一l面向对象的APIQ可方便地在python中访问ldap目录服务Q它ZOpenLDAP2.x?br>  smtplib模块 ———?发送电(sh)子邮件?br>  ftplib模块 ———?定义了FTPcd一些方法,用以q行客户端的ftp~程。我们可用python~写一个自qftp客户端程序,用于下蝲文g或镜像站炏V如果想了解ftp协议的详l内容,请参考RFC959?br>  xmpppy模块 ———?Jabber服务器采用开发的XMPP协议QGoogle Talk也是采用XMPP协议的IMpȝ。在Python中有一个xmpppy模块支持该协议。也是_我们可以通过该模块与Jabber服务器通信Q是不是很Cool?br>  下面q些׃详细介绍Q只列出名字和功?br>  adodb ———?ADO数据库连接组?br>  bsddb3 ———?BerkeleyDB的连接组?br>  chardet ———?~码?br>  Cheetah ———?构徏和扩充Q何种cȝZ文本的内?br>  cherrypy ———?一个WEB framework<br>  ctypes ———?用来调用动态链接库<br>  Cx-oracle ———?q接oracle的工?br>  DBUtils ———?数据库连接池<br>  django ———?一个WEB framework<br>  DPKT ———?raw-scoket|络~程<br>  docutils ———?用来写文的<br>  dpkt ———?数据包的解包和组?br>  feedparser ———?rss解析<br>  Kodos ———?正则表达式调试工?br>  Mechanize ———?爬虫q接|站常用<br>  pefile ———?windows pe文g解析?br>  py2exe ———?用来生成windows可执行文?br>  pycurl ———?URL处理工具<br>  pydot ———?d的,graphiz<br>  pyevent ———?Python的事件支?br>  pylint ———?培养良好的编码习?br>  Pylons ———?又一个web framework<br>  pypcap ———?抓包?br>  pysqlite2 ———?SQLite的连接组?br>  python-dnet ———?控制|络安全的其他设?br>  pythonwin ———?Python的Windows扩展<br>  pywmi ———?省了好多折腾功夫<br>  reportlab ———?Python操作PDF的Libary?br>  scapy ———?|络包构建分析框?可编E的wireshark,有兴的google “Silver Needle in the Skype”<br>  scons ———?目构徏工具Q写好了模板用v来还是很方便?br>  sendpkt ———?Python发包<br>  setuptools ———?一套python包管理机?br>  simplejson ———?JSON的支?br>  sqlalchemy ———?SQL数据库连接池<br>  SQLObject ———?数据库连接池<br>  twisted ———?巨无霸的|络~程框架<br>  winpdb ———?自己的程序或者用别的库不太明白的时候就靠它?br>  wxPython ———?GUI~程框架,熟?zhn)MFC的h会非常喜Ƣ,直是同一架构</fieldset> <img src ="http://www.shnenglu.com/Hero/aggbug/91582.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Hero/" target="_blank">Hero</a> 2009-07-29 14:01 <a href="http://www.shnenglu.com/Hero/archive/2009/07/29/91582.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>os.walk()http://www.shnenglu.com/Hero/archive/2009/07/29/91566.htmlHeroHeroWed, 29 Jul 2009 02:59:00 GMThttp://www.shnenglu.com/Hero/archive/2009/07/29/91566.htmlhttp://www.shnenglu.com/Hero/comments/91566.htmlhttp://www.shnenglu.com/Hero/archive/2009/07/29/91566.html#Feedback0http://www.shnenglu.com/Hero/comments/commentRss/91566.htmlhttp://www.shnenglu.com/Hero/services/trackbacks/91566.html 

Generate the file names in a directory tree by walking the tree either top-down or bottom-up. For each directory in the tree rooted at directory top (including top itself), it yields a 3-tuple (dirpath, dirnames, filenames).

dirpath 
is a string, the path to the directory. dirnames is a list of the names of the subdirectories in dirpath (excluding '.' and '..'). filenames is a list of the names of the non-directory files in dirpath. Note that the names in the lists contain no path components. To get a full path (which begins with top) to a file or directory in dirpath, do os.path.join(dirpath, name).

If optional argument topdown 
is True or not specified, the triple for a directory is generated before the triples for any of its subdirectories (directories are generated top-down). If topdown is False, the triple for a directory is generated after the triples for all of its subdirectories (directories are generated bottom-up).

When topdown 
is True, the caller can modify the dirnames list in-place (perhaps using del or slice assignment), and walk() will only recurse into the subdirectories whose names remain in dirnames; this can be used to prune the search, impose a specific order of visiting, or even to inform walk() about directories the caller creates or renames before it resumes walk() again. Modifying dirnames when topdown is False is ineffective, because in bottom-up mode the directories in dirnames are generated before dirpath itself is generated.

By default errors 
from the listdir() call are ignored. If optional argument onerror is specified, it should be a function; it will be called with one argument, an OSError instance. It can report the error to continue with the walk, or raise the exception to abort the walk. Note that the filename is available as the filename attribute of the exception object.

By default, walk() will 
not walk down into symbolic links that resolve to directories. Set followlinks to True to visit directories pointed to by symlinks, on systems that support them.

New 
in version 2.6: The followlinks parameter.

Note

Be aware that setting followlinks to True can lead to infinite recursion 
if a link points to a parent directory of itself. walk() does not keep track of the directories it visited already.

Note

If you 
pass a relative pathname, don’t change the current working directory between resumptions of walk(). walk() never changes the current directory, and assumes that its caller doesn’t either.

This example displays the number of bytes taken by non
-directory files in each directory under the starting directory, except that it doesn’t look under any CVS subdirectory:

import os
from os.path import join, getsize
for root, dirs, files in os.walk('python/Lib/email'):
    
print root, "consumes",
    
print sum(getsize(join(root, name)) for name in files),
    
print "bytes in", len(files), "non-directory files"
    
if 'CVS' in dirs:
        dirs.remove(
'CVS')  # don't visit CVS directories
In the next example, walking the tree bottom-up is essential: rmdir() doesn’t allow deleting a directory before the directory is empty:

# Delete everything reachable from the directory named in "top",
#
 assuming there are no symbolic links.
#
 CAUTION:  This is dangerous!  For example, if top == '/', it
#
 could delete all your disk files.
import os
for root, dirs, files in os.walk(top, topdown=False):
    
for name in files:
        os.remove(os.path.join(root, name))
    
for name in dirs:
        os.rmdir(os.path.join(root, name))

 



Hero 2009-07-29 10:59 发表评论
]]>
þ99Ʒ鶹լլ| þþþһƷ| һɫþHEZYO| Ʒ99þþþƷ| AVĻþר| þþwww| 99þþƷһѿ| þþƷƷƾ| Ʒþþþþþapp| ƷþþþþóAV| 뾫ƷþɪӰ| avպƷþþþþa| Ʒ99þþþþö| ۺϾþһ| þ99Ʒ99þ| þֻоƷҳ| ˾Ʒþ޸岻| þþþþþƷѿSSS| Ʒ99þþþþ| ˺ݺۺϾþ| þþƷһ| vaþþþͬ| 99þþù| þùŷպƷ| þAV߳AVAV| þþþAVרɫ | þseƷһƷ| ŷѹۿþ| þþþþྫƷֱ| þerƵᆱƷ| þ99ڹ| þþþþþþþþþþþ| ɫ͵͵88ŷƷþþ| þþþۺĻ| þþþƷר| 777þþƷһ| Aݺݾþɫ| .Ʒþþ鶹Ʒ| ھƷþþþӰԺ| þþƷ| þ99þ99СݾƷӿ|