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 閱讀(3864) 評論(0)  編輯  收藏 所屬分類: python

          常用鏈接

          留言簿(21)

          隨筆分類(265)

          隨筆檔案(242)

          相冊

          JAVA網站

          關注的Blog

          搜索

          •  

          積分與排名

          • 積分 - 917238
          • 排名 - 40

          最新評論

          主站蜘蛛池模板: 秦皇岛市| 从江县| 桂林市| 榕江县| 平凉市| 通许县| 邛崃市| 邯郸市| 哈尔滨市| 松潘县| 台东市| 敖汉旗| 呼玛县| 长顺县| 武威市| 兰西县| 邳州市| 南和县| 巨鹿县| 文化| 吕梁市| 松溪县| 娱乐| 蓝山县| 邹平县| 偏关县| 彭山县| 昌乐县| 和硕县| 莱西市| 易门县| 五原县| 从化市| 科技| 江西省| 公安县| 得荣县| 措美县| 灵石县| 龙泉市| 招远市|