import os
          import shutil

          def CleanDir( Dir ):
          ??? if os.path.isdir( Dir ):
          ??????? paths = os.listdir( Dir )
          ??????? for path in paths:
          ??????????? filePath = os.path.join( Dir, path )
          ??????????? if os.path.isfile( filePath ):
          ??????????????? try:
          ??????????????????? os.remove( filePath )
          ??????????????? except os.error:
          ??????????????????? autoRun.exception( "remove %s error." %filePath )#引入logging
          ??????????? elif os.path.isdir( filePath ):
          ??????????????? if filePath[-4:].lower() == ".svn".lower():
          ??????????????????? continue
          ??????????????? shutil.rmtree(filePath,True)
          ??? return True

          Dir = "D:\\Temp"
          CleanDir(Dir)
          今天是學習python的第三天,被羞辱了。剛開始沒有引入import shutil 。而這句 shutil.rmtree(filePath,True) 提示未定義。自己卻不知道該引入哪個包。問網友就被笑話了。

          還有發現那個群好多人BS 學java的,我覺得心胸狹隘。技術搞得也像臺灣政黨間互相攻擊一樣。。。。
          其實java 、C++、C、匯編、或者web開發中常見的jsp,php,asp,net 或者javascript、python腳本語言也好。存在總有必然性,總有其價值。不管哪門你都沒有資格去鄙視他。

          posted on 2008-04-11 11:15 -274°C 閱讀(3863) 評論(0)  編輯  收藏 所屬分類: python

          常用鏈接

          留言簿(21)

          隨筆分類(265)

          隨筆檔案(242)

          相冊

          JAVA網站

          關注的Blog

          搜索

          •  

          積分與排名

          • 積分 - 916101
          • 排名 - 40

          最新評論

          主站蜘蛛池模板: 瓮安县| 乌苏市| 茂名市| 沂源县| 松原市| 克拉玛依市| 金乡县| 噶尔县| 林口县| 锡林浩特市| 茶陵县| 灵武市| 迁西县| 全南县| 开封市| 泰来县| 崇明县| 辽源市| 新和县| 香港| 汪清县| 通州市| 营口市| 社会| 临澧县| 永年县| 尼木县| 普兰店市| 三穗县| 海城市| 娄底市| 昌江| 滁州市| 增城市| 修文县| 贵南县| 昆山市| 牙克石市| 浦县| 色达县| 岑溪市|