国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

在Python中移動目錄結構的方法

2019-11-25 16:57:21
字體:
來源:轉載
供稿:網友

來源:http://stackoverflow.com/questions/3806562/ways-to-move-up-and-down-the-dir-structure-in-python

#Moving up/down dir structureprint os.listdir('.') # current levelprint os.listdir('..') # one level upprint os.listdir('../..') # two levels up # more complex example:# This will walk the file system beginning in the directory the script is run from. It # deletes the empty directories at each level for root, dirs, files in os.walk(os.getcwd()):  for name in dirs:    try:      os.rmdir(os.path.join(root, name))    except WindowsError:      print 'Skipping', os.path.join(root, name)			

This will walk the file system beginning in the directory the script is run from. It deletes the empty directories at each level.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 志丹县| 六盘水市| 连云港市| 佛教| 大关县| 彭阳县| 宕昌县| 余干县| 突泉县| 西安市| 磐石市| 淮滨县| 横山县| 格尔木市| 邳州市| 通辽市| 中江县| 枝江市| 南靖县| 西乌珠穆沁旗| 麻栗坡县| 通渭县| 克山县| 甘泉县| SHOW| 福州市| 南江县| 乐安县| 永川市| 城步| 三门县| 奉化市| 营口市| 普安县| 普宁市| 商城县| 南澳县| 安达市| 夏津县| 尼木县| 东明县|