摘要: os和os.path模塊
os.listdir(dirname):列出dirname下的目錄和文件
os.getcwd():獲得當前工作目錄
os.curdir:返回但前目錄('.')
os.chdir(dirname):改變工作目錄到dirname
os.path.isdir(name):判斷name是不是一個目錄,name不是目錄就返回false
os.path.isfile(name):判斷name是不是一個文件,不存在name也返回false
os.path.exists(name):判斷是否存在文件或目錄name
os.path.getsize(name):獲得文件大小,如果name是目錄返回0L
os.path.abspath(name):獲得絕對路徑
os.path.normpath(path):規范path字符串形式
os.path.split(name):分割文件名與目錄(事實上,如果你完全使用目錄,它也會將最后一個目錄作為文件名而分離,同時它不會判斷文件或目錄是否存在)
閱讀全文
os.listdir(dirname):列出dirname下的目錄和文件
os.getcwd():獲得當前工作目錄
os.curdir:返回但前目錄('.')
os.chdir(dirname):改變工作目錄到dirname
os.path.isdir(name):判斷name是不是一個目錄,name不是目錄就返回false
os.path.isfile(name):判斷name是不是一個文件,不存在name也返回false
os.path.exists(name):判斷是否存在文件或目錄name
os.path.getsize(name):獲得文件大小,如果name是目錄返回0L
os.path.abspath(name):獲得絕對路徑
os.path.normpath(path):規范path字符串形式
os.path.split(name):分割文件名與目錄(事實上,如果你完全使用目錄,它也會將最后一個目錄作為文件名而分離,同時它不會判斷文件或目錄是否存在)
閱讀全文
常用鏈接
留言簿(21)
隨筆分類(265)
- android(1)
- c#(.net)(1)
- C++(33)
- DB(5)
- JAVA(38)
- JSP(17)
- linux(7)
- mac(10)
- nginx(3)
- PHP(20)
- python(19)
- UML(1)
- VML(1)
- WebService(2)
- web前端(71)
- XML(4)
- 感悟生活(5)
- 正則表達式(2)
- 計算機綜合(25)
隨筆檔案(242)
- 2012年5月 (1)
- 2012年4月 (2)
- 2011年12月 (9)
- 2011年11月 (20)
- 2011年3月 (8)
- 2010年10月 (15)
- 2010年6月 (2)
- 2010年4月 (1)
- 2010年3月 (7)
- 2010年1月 (4)
- 2009年12月 (1)
- 2009年10月 (1)
- 2009年9月 (1)
- 2009年8月 (8)
- 2009年6月 (11)
- 2009年5月 (3)
- 2009年4月 (7)
- 2008年11月 (5)
- 2008年10月 (6)
- 2008年8月 (1)
- 2008年7月 (6)
- 2008年6月 (5)
- 2008年5月 (1)
- 2008年4月 (18)
- 2008年3月 (1)
- 2008年2月 (1)
- 2007年12月 (9)
- 2007年9月 (5)
- 2007年8月 (6)
- 2007年7月 (4)
- 2007年6月 (6)
- 2007年5月 (8)
- 2007年4月 (9)
- 2007年3月 (6)
- 2007年2月 (44)
相冊
JAVA網站
關注的Blog
搜索
積分與排名
- 積分 - 914054
- 排名 - 40
最新評論

- 1.?re: IP地址獲取當前地理位置接口
- fdf
- --fdfs
- 2.?re: 淺談comet技術
- slowhttp攻擊會直接把server搞垮 因為通常這種應用場景的http的timeout值會比較大
- --harlan
- 3.?re: php動態圖片驗證碼
- 額
- --人
- 4.?re: 關于傳值和傳引用的插曲
- 大家不要看這篇文章 本來很簡單的事情反而被博主繞復雜了,
- --bandit