use '~' and os.path.expanduser() instead of hardcoded path for cache path