Guest User

Untitled

a guest
Jan 13th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import os
  2. import pickle
  3. import bz2
  4.  
  5.  
  6. def main():
  7.     dir_names = sorted(os.listdir('/usr/bin'))
  8.     with bz2.open('name_cache.bz2', 'wb') as name_cache_file:
  9.         cached_bytes = pickle.dumps(dir_names, protocol=4)
  10.         name_cache_file.write(cached_bytes)
  11.  
  12.  
  13. if __name__ == '__main__':
  14.     main()
Advertisement
Add Comment
Please, Sign In to add comment