fork download
  1. import os, tempfile
  2.  
  3. d = tempfile.mkdtemp()
  4.  
  5. os.system("""
  6. cd "{0}"
  7. mkdir -p one/sample another/too
  8. touch one/file one/sample/more another/also another/too/many""".format(d))
  9. for root, directories, filenames in os.walk(top=d):
  10. print("{0!r}".format(filenames))
  11. os.system("rm -rf '{0}'".format(d))
  12.  
Success #stdin #stdout 0s 33864KB
stdin
Standard input is empty
stdout
[]
['also']
['many']
['file']
['more']