Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import pickle
- import bz2
- def main():
- dir_names = sorted(os.listdir('/usr/bin'))
- with bz2.open('name_cache.bz2', 'wb') as name_cache_file:
- cached_bytes = pickle.dumps(dir_names, protocol=4)
- name_cache_file.write(cached_bytes)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment