File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,8 @@ Initialize the GPIB adapter
57
57
``` python
58
58
from async_gpib.async_gpib import AsyncGpib
59
59
# Create a controller and talk to device address 22
60
- gpib_device = AsyncGpib(name = 0 , pad = 22 )
61
-
62
- # Connect to the controller. This must be done inside the loop
63
- await gpib_device.connect()
64
-
65
- # Add your code here
66
-
67
- # Disconnect after we are done
68
- await gpib_device.disconnect()
60
+ async with AsyncGpib(name = 0 , pad = 22 ) as gpib_device:
61
+ ...
69
62
```
70
63
See [ examples/] ( examples/ ) for more working examples.
71
64
@@ -87,4 +80,3 @@ I use the [Numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) styl
87
80
88
81
89
82
This project is licensed under the GPL v3 license - see the [ LICENSE] ( LICENSE ) file for details
90
-
You can’t perform that action at this time.
0 commit comments