We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 756904d commit 2df27a1Copy full SHA for 2df27a1
1. Origin-Python Data Exchange/Worksheet User Tree Access.py
@@ -0,0 +1,20 @@
1
+'''
2
+This sample shows how to set values to worksheet tree nodes, and
3
+then read out into a tree object. This is useful to save the metadata
4
+of a data file. See the blog:
5
+https://blog.originlab.com/accessing-metadata-using-python
6
7
+
8
+import originpro as op
9
10
+# Create a new worksheet and set worksheet tree values.
11
+wks = op.new_sheet()
12
+wks.set_str("tree.data.name", "Larry")
13
+wks.set_int("tree.data.age", 37)
14
+wks.set_float("tree.data.mean", 23.56)
15
16
+# Save the worksheet tree values to a tree object and print out the values.
17
+trWks = wks.usertree
18
+trData = trWks.find('data')
19
+for child in trData:
20
+ print(f'{child.tag} = {child.text}')
0 commit comments