Changeset 6435
- Timestamp:
- Jul 21, 2016, 6:39:00 PM (8 years ago)
- Location:
- trunk/lang/python/Rappture
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/python/Rappture/__init__.py
r5592 r6435 10 10 import Utils 11 11 import encoding 12 from raptool import Tool 12 13 13 14 # encoding/decoding flags -
trunk/lang/python/Rappture/python_api.rst
r5669 r6435 257 257 258 258 259 260 ---------- 261 262 RUNNING RAPPTURE TOOLS FROM PYTHON 263 ---------------------------------- 264 265 If you want to write a Python program that runs Rappture tools, you can do it with the above API and 266 the Rappture Tool class. For example, to run a published tool named "complam": 267 268 .. code-block:: python 269 270 import Rappture 271 io = Rappture.Tool("complam") 272 273 # Set input values for the Complam tool 274 material = io['input.group(tabs).group(Material)'] 275 material['number(E1).current'] = E1 / 1e9 276 material['number(E2).current'] = E2 / 1e9 277 278 # run the tool 279 io.run() 280 281 # read the results 282 ex = io['output.number(Ex).current'].value 283 nu = io['output.number(nu).current'].value 284 259 285 REFERENCE 260 286 ========= … … 272 298 ------- 273 299 274 - node.close( )275 Writes out the XML.300 - node.close(status=0) 301 Sets the output status field and writes out the XML. 276 302 277 303 Reading -
trunk/lang/python/Rappture/pyxml.py
r5669 r6435 79 79 return elem.xml() 80 80 81 def close(self): 81 def close(self, status=0): 82 self.lib.result(status) 82 83 result(self.lib) 84
Note: See TracChangeset
for help on using the changeset viewer.