Number Input Example ==================== Location: ``examples/webapp/number/`` This example demonstrates the ```` input type with units, min/max bounds, presets, and a color bar. tool.xml -------- .. code-block:: xml number (rappture2web) python3 @tool/number.py @driver Temperature of the environment. K 50K 1000K 300K purple 300K 77K script ------ .. code-block:: python import sys import rappture2web.rp_library as Rappture rx = Rappture.PyXml(sys.argv[1]) T_str = rx['input.(temperature).current'].value T = float(Rappture.Units.convert(T_str, to='K', units='off')) # Use the temperature in your calculation... rx['output.number(T).about.label'] = 'Temperature' rx['output.number(T).units'] = 'K' rx['output.number(T).current'] = f'{T:.1f}K' rx.close() Running ------- .. code-block:: bash rappture2web examples/webapp/number/