在运行时创建临时pkg_资源入口点。

prybar的Python项目详细描述


CI StatusDocumentation StatusPyPI - Status

用于临时定义pkg_resourcesentry points的python库 在运行时。主要用例是测试与入口点一起工作的代码。

安装

$ pip install prybar

Prybar需要Python3.6或更高版本。

用法

>>> importprybar>>> frompkg_resourcesimportiter_entry_points>>> # Entry point doesn't exist>>> list(iter_entry_points('example.hash_types','sha256'))[]
>>> # With prybar's context manager we can create entry points temporarily>>> withprybar.dynamic_entrypoint('example.hash_types',... name='sha256',module='hashlib'):... hash=next(iter_entry_points('example.hash_types','sha256')).load()... hash(b'foo').hexdigest()[:6]'2c26b4'
>>> # And it's gone again>>> list(iter_entry_points('example.hash_types','sha256'))[]

有关详细信息,请参见full documentation

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
反射Java getMethod()会导致NoSuchMethodException错误   编译器构造Java编译时错误:解析时到达文件末尾   java我无法使用Spring Boot从应用程序引擎中的服务连接到Google数据存储   java单一注销配置文件Idp注销问题   regex如何在java中编写和使用正则表达式   java Android:单击标签打开电子邮件应用程序   java如何确保函数执行函数的整个检查?   java如何将字母数字电话号码转换为数字   listview更改中项目内部的java ImageView   java将空对象转换为整数   对等端重置java Google Drive SDk连接   在java程序中测试未授权的隐藏测试(代码战)