用于向用户路径添加位置的跨平台工具,不需要sudo/runas!
adduserpath的Python项目详细描述
曾经想发布一个很酷的新应用,但发现很难添加 用户的位置到路径?我也是!这个工具可以帮你 主要操作系统,不需要提升权限!
Fear not, this only modifies the user PATH; the system PATH is never touched nor even looked at!
安装
adduserpath作为一个通用的 wheel和在linux/macos和windows上可用,并支持 python 2.6-2.7/3.3+和pypy。
$ pip install adduserpath
命令
只有3个!
$ userpath -h Usage: userpath [OPTIONS] COMMAND [ARGS]... Options: --version Show the version and exit. -h, --help Show this message and exit. Commands: append Appends to the user PATH prepend Prepends to the user PATH verify Checks if locations are in the user PATH
API
>>>importuserpath>>>location=r'C:\Users\Ofek\Desktop\test'>>>>>>userpath.in_current_path(location)False>>>userpath.in_new_path(location)False>>>userpath.append(location)True>>>userpath.in_new_path(location)True>>>userpath.need_shell_restart(location)True