Python 调用C# 删除所有文件

来源:互联网 发布:设计软件图标 编辑:程序博客网 时间:2024/06/06 19:26
import clr
clr.AddReference("System")
clr.AddReference("System.Xml")
from System.Xml import *
from System.IO import *

def DeleteFiles(sPath):
    #在此处插入函数正文
    dir = DirectoryInfo(sPath);
    fs = dir.GetFiles("*.*")
    for f in fs:
        f.Delete()
    #函数末尾
    return
0 0
原创粉丝点击