Skip to content

Commit 2bb8243

Browse files
committed
Update README.md
1 parent c4489c0 commit 2bb8243

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,19 @@ my_program.save("HELLO.8xp", model=TI_83P)
117117
> [!IMPORTANT]
118118
> `.save()` uses the var's name as the filename, saving to the current working directory.
119119
120-
Any input data type can also be exported to:
120+
To package an entry into a var file, use `.export`:
121+
122+
```python
123+
my_var = my_program.export()
124+
125+
# This is just the entry's data
126+
my_program.bytes()
127+
128+
# This is a complete var file
129+
my_var.bytes()
130+
```
131+
132+
You can also export entries to any of their input data types:
121133

122134
```python
123135
assert my_program.string() == "Disp \"HELLO WORLD!\""
@@ -191,13 +203,20 @@ with open("HELLO.8xp", 'rb') as file:
191203
```
192204

193205
An entry can be exported to a var, with an optional attached header; likewise, a var is made up of its header and entries:
206+
194207
```python
195208
my_var = my_program.export(header=my_header)
196209

197210
assert my_header = my_var.header
198211
assert my_program == my_var.entries[0]
199212
```
200213

214+
Pipe syntax is supported for forming a var with multiple entries:
215+
216+
```python
217+
my_big_var = TIHeader(comment="muy grande") | [TIEntry(name="A"), TIEntry(name="B")]
218+
```
219+
201220
Export a var as bytes or straight to a file:
202221

203222
```python

0 commit comments

Comments
 (0)