Easiest way to rm -rf in Python

前端 未结 7 1553
忘了有多久
忘了有多久 2020-12-08 12:44

What is the easiest way to do the equivalent of rm -rf in Python?

相关标签:
7条回答
  • 2020-12-08 13:34

    Just do this:

    import os
    dirname = "path_to_directory_to_remove"
    os.system("rm -rf %s" % dirname)
    
    0 讨论(0)
提交回复
热议问题