Life is short, you need Python

摘要: File System -- os, os.path, shutilThe *os* and *os.path* modules include many functions to interact with the file system. The *shutil* module can copy files.os module docs filenames = os.listdir(dir) -- list of filenames in that directory path (not including . and ..). The filenames are just the nam 阅读全文
posted @ 2011-04-28 15:32 runfox545 阅读(548) 评论(0) 推荐(0)
摘要: sina微博http://t.sina.com.cn/1941893380没办法,被逼的!! 阅读全文
posted @ 2011-04-28 11:16 runfox545 阅读(734) 评论(0) 推荐(0)
摘要: 在需要在字符中使用特殊字符时,python用反斜杠(\)转义字符。如下表:原始字符串有时我们并不想让转义字符生效,我们只想显示字符串原来的意思,这就要用r和R来定义原始字符串。如:print r'\t\r'实际输出为“\t\r”。转义字符描述\(在行尾时)续行符\\反斜杠符号\'单引号\"双引号\a响铃\b退格(Backspace)\e转义\000空\n换行\v纵向制表符\t横向制表符\r回车\f换页\oyy八进制数yy代表的字符,例如:\o12代表换行\xyy十进制数yy代表的字符,例如:\x0a代表换行\other其它的字符以普通格式输出 阅读全文
posted @ 2011-04-28 10:48 runfox545 阅读(152627) 评论(5) 推荐(3)
白月黑羽 Python教程 白月黑羽Python