use os.path.expanduser() in order to support $HOME path "~"

use os.path.expanduser() in order to support $HOME path "~" in *nix system