Skip to content

Commit a18b1bd

Browse files
authored
Updated code highlighting
1 parent ed76b0d commit a18b1bd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is an (extremely early) minimal Python client for LabThings devices
44

55
## Usage example
66

7-
```
7+
```python
88
import atexit
99
from labthings_client.discovery import ThingBrowser
1010

@@ -19,22 +19,26 @@ thing = browser.wait_for_first()
1919

2020
### Managing properties
2121

22-
```
22+
```python
2323
>>> thing.properties
2424
{'pdfComponentMagicDenoise': <affordances.Property object at 0x00000288F4095548>}
25+
2526
>>> thing.properties.pdfComponentMagicDenoise.set(500)
2627
500
28+
2729
>>> thing.properties.pdfComponentMagicDenoise.get()
2830
500
31+
2932
>>>
3033
```
3134

3235

3336
### Managing actions
3437

35-
```
38+
```python
3639
>>> thing.actions
3740
{'averageDataAction': <affordances.Action object at 0x00000288F40955C8>}
41+
3842
>>> thing.actions.averageDataAction.args
3943
{'type': <class 'dict'>,
4044
'properties': {'n': {'format': 'int32',
@@ -46,9 +50,12 @@ thing = browser.wait_for_first()
4650
'required': False,
4751
'type': <class 'list'>}},
4852
}
53+
4954
>>> thing.actions.averageDataAction(n=10)
5055
<tasks.ActionTask object at 0x00000288F40D1348>
56+
5157
>>> thing.actions.averageDataAction(n=10).wait()
5258
[0.0013352326078147302, 0.0008734229673564006, 0.0009756767699519994, 0.0008614760409831329, ...
59+
5360
>>>
54-
```
61+
```

0 commit comments

Comments
 (0)