kopia lustrzana https://github.com/micropython/micropython-lib
pkgutil: Add get_data(), depends on pkg_resources.resource_stream().
rodzic
64041bdb62
commit
02f81e110a
|
@ -0,0 +1,8 @@
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
|
def get_data(package, resource):
|
||||||
|
f = pkg_resources.resource_stream(package, resource)
|
||||||
|
try:
|
||||||
|
return f.read()
|
||||||
|
finally:
|
||||||
|
f.close()
|
Ładowanie…
Reference in New Issue