Skip to content

Commit

Permalink
Replaced gom.app.resource by gom.Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mprinkezs committed Oct 28, 2024
1 parent 8abf1f8 commit 018f62f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Demonstration for accessing App based resources via scripts.
Resources are addressed with a relative or absolute file system path. In this example, the path relative to the Python script file is used:

```python
data = gom.app.resource["assets/zeiss_logo.png"]
with gom.Resource("assets/zeiss_logo.png").open() as fh:
data = fh.read()
```

The equivalent absolute path is `:Resources/assets/zeiss_logo.png`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
import gom

#
# Resources are addressed with a relative or absolute file system path
# Resources are addressed with a relative or absolute file system path.
#
data = gom.app.resource["assets/zeiss_logo.png"]
with gom.Resource("assets/zeiss_logo.png").open() as fh:
data = fh.read()

print ('Type:', type (data))
print ('Size:', len (data))
Expand Down

0 comments on commit 018f62f

Please sign in to comment.