Skip to content

Commit 457ea8d

Browse files
Use a lambda rather than the defined function.
1 parent ebe736b commit 457ea8d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

docs/examples/example_read_from_ioc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,4 @@
66
print(caput("MY-DEVICE-PREFIX:AO", "999"))
77
print(caget("MY-DEVICE-PREFIX:AO"))
88

9-
def print_val(value: float):
10-
print(value)
11-
129
softioc.interactive_ioc(globals())

docs/how-to/read-data-from-ioc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ We will read data from that IOC using this script:
2424
From the interactive command line you can now use the ``caget`` and ``caput`` functions to operate on
2525
the PVs exposed in the IOC. Another interesting command to try is::
2626

27-
camonitor("MY-DEVICE-PREFIX:AI", print_val)
27+
camonitor("MY-DEVICE-PREFIX:AI", lambda val: print(val))
2828

2929

30-
You should observe the value of ``AI`` being printed out, once per second, every time the PVs value
30+
You should observe the value of ``AI`` being printed out, once per second, every time the PV value
3131
updates.

0 commit comments

Comments
 (0)