Share Pastebin
Guest
Public paste!

sage

By: a guest | Aug 29th, 2008 | Syntax: Python | Size: 0.24 KB | Hits: 115 | Expires: Never
Copy text to clipboard
  1. def make_path(n) :
  2.     dirs,file = divmod(n,100)
  3.     filenameparts = ["99","%02d" % file]
  4.     while dirs != 0 :
  5.         dirs,lastdir = divmod(dirs,99)
  6.         filenameparts.insert(0,"%02d"%lastdir)
  7.     return os.path.join(filenameparts)