用于将位置添加到用户 PATH 的跨平台工具,无需 sudo/runas!
项目描述
曾经想发布一个很酷的新应用程序,但发现很难将其位置添加到用户的 PATH 中?我也是!该工具可以在所有主要操作系统上为您执行此操作,并且不需要提升权限!
<nav class="contents" id="table-of-contents" role="doc-toc">不用担心,这只会修改用户 PATH;系统 PATH 从未被触及,甚至未被查看!
目录
</nav>安装
adduserpath 作为通用轮子在PyPI上分发,可在 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
>>> import userpath
>>> 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
执照
userpath 是根据两者的条款分发的
由您选择。
项目详情
关
adduserpath -0.4.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d12612a529028a2bda79f5111eab6ba4b787625b3fd8958f47ac9371ea9a76dc |
|
MD5 | cb1cf1377ed08f19ceecea93bf556a07 |
|
布莱克2-256 | adcb50f2be266f19130308cd705a3556f1d06220a5ca60a446c496a485b12726 |
关
adduserpath -0.4.0-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3494c0a58b8792c05feccfc3a4d3aee6b02ce469dab33798b4eae7622f631d7d |
|
MD5 | 6f7be9ef96db27c847f8325ba20a0cb5 |
|
布莱克2-256 | e8533035ff330183156e93295f5e83735ae1626ad38e215fdf837fe20ba0fab0 |