source: branches/uq/examples/zoo/string/string_test.py @ 5788

Last change on this file since 5788 was 5788, checked in by mmh, 9 years ago

add python example

File size: 937 bytes
Line 
1# ----------------------------------------------------------------------
2#  EXAMPLE: Rappture <string> elements
3# ======================================================================
4#  AUTHOR:  Martin Hunt, Purdue University
5#  Copyright (c) 2015  HUBzero Foundation, LLC
6#
7#  See the file "license.terms" for information on usage and
8#  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9# ======================================================================
10
11import Rappture
12import sys
13
14# open the XML file containing the run parameters
15rx = Rappture.PyXml(sys.argv[1])
16
17title = rx['input.(title).current'].value
18indeck = rx['input.(indeck).current'].value
19
20rx['output.string(outt).about.label'] = "Echo of title"
21rx['output.string(outt).current'] = title
22rx['output.string(outi).about.label'] = "Echo of input"
23rx['output.string(outi).current'] = indeck
24
25# save the updated XML describing the run...
26rx.close()
Note: See TracBrowser for help on using the repository browser.