1 Star 1 Fork 1

icedRabbit/micropython-lib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pkg_resources.py 693 Bytes
一键复制 编辑 原始数据 按行查看 历史
import uio
c = {}
def resource_stream(package, resource):
if package not in c:
try:
if package:
p = __import__(package + ".R", None, None, True)
else:
p = __import__("R")
c[package] = p.R
except ImportError:
if package:
p = __import__(package)
d = p.__path__
else:
d = "."
# if d[0] != "/":
# import uos
# d = uos.getcwd() + "/" + d
c[package] = d + "/"
p = c[package]
if isinstance(p, dict):
return uio.BytesIO(p[resource])
return open(p + resource, "rb")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iceRabbit/micropython-lib.git
git@gitee.com:iceRabbit/micropython-lib.git
iceRabbit
micropython-lib
micropython-lib
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385