Fix: ~/ does not work as path, use os.path.expanduser