您的位置: 首页 > IT文章 > 删除文件 删除文件 分类: IT文章 • 2024-03-16 22:31:37 import osmy_file = '23.txt'if os.path.exists(my_file): #删除文件,可使用以下两种方法。 os.remove(my_file) #os.unlink(my_file)