• 获得discuz7.2 目录下所有文件,并写到txt


     1 # -*- coding: utf-8 -*-
     2 
     3 
     4 import os
     5 
     6 
     7 fileList = []
     8 dzList = []
     9 
    10 def GetFileList(path):
    11     List = []
    12     for root,dirs,files in os.walk(path):
    13         for fn in files:
    14             List.append(root + os.sep + fn)
    15     return List
    16 
    17 def GetUrlPath(List):
    18     UrlPathList = []
    19     f = open("discuz72.txt","w")
    20     for ll in List:
    21         f.write( "/".join(ll[ll.find("dz72")+len("dz72"):].split(os.sep)))
    22         f.write(os.linesep)
    23 
    24 if __name__ == "__main__":
    25     GetUrlPath(GetFileList(r"E:xampphtdocsdz72"))

    我的本地网站根目录是htdocs,discuz7.2存储在dz72目录下。

  • 相关阅读:
    ohmyzsh
    https://github.com/
    init 0,1,2,3,4,5,6
    关于反射
    docker学习笔记
    docker常见问题汇总
    ArrayList的sublist
    java-锁
    CAS-原子操作
    hashMap与concurrentHashMap
  • 原文地址:https://www.cnblogs.com/tk091/p/3510743.html
Copyright © 2020-2023  润新知