python中 os.path模块中 符号'~' 表示的是我们用户名的根路径path = '~/data.txt'tmp = os.path.expanduser(path)print(tmp)>>>C:\Users\Fairy/data.txt