2017-05-02 18:47:14 -04:00
|
|
|
import uio
|
2020-06-18 05:19:14 -04:00
|
|
|
import usys
|
2017-05-02 18:47:14 -04:00
|
|
|
|
|
|
|
try:
|
|
|
|
uio.resource_stream
|
|
|
|
except AttributeError:
|
|
|
|
print("SKIP")
|
2017-06-10 13:14:16 -04:00
|
|
|
raise SystemExit
|
2017-05-02 18:47:14 -04:00
|
|
|
|
2017-05-06 11:42:35 -04:00
|
|
|
buf = uio.resource_stream("data", "file2")
|
|
|
|
print(buf.read())
|
2017-05-02 18:47:14 -04:00
|
|
|
|
|
|
|
# resource_stream(None, ...) look ups from current dir, hence sys.path[0] hack
|
2020-06-18 05:19:14 -04:00
|
|
|
buf = uio.resource_stream(None, usys.path[0] + "/data/file2")
|
2017-05-02 18:47:14 -04:00
|
|
|
print(buf.read())
|