跳转到主要内容

跨平台工具,用于将位置添加到用户PATH,无需sudo/runas权限!

项目描述

Latest PyPI version Travis CI AppVeyor CI Supported Python versions License

是否曾经想要发布一个酷炫的新应用程序,但发现很难将其位置添加到用户的PATH中?我也是!这个工具为您在所有主流操作系统上完成这个任务,并且不需要提升权限!

不必担心,这个工具仅修改用户PATH;系统PATH从未被修改,甚至从未查看过!

安装

adduserpath作为通用wheel在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
Example run

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根据您的选择以MIT许可证和Apache许可证2.0的条款分发。

任选其一。

项目详情


下载文件

下载适合您平台文件的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码发行版

adduserpath-0.4.0.tar.gz (9.4 kB 查看哈希值)

上传时间 源码

构建发行版

adduserpath-0.4.0-py2.py3-none-any.whl (8.1 kB 查看哈希值)

上传时间 Python 2 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面