diff options
| author | morefigs <morefigs@gmail.com> | 2019-01-29 10:18:57 +1100 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2019-01-29 10:18:57 +1100 |
| commit | 220fd5201be8d1a149abcf1637ed8bcc04123dfe (patch) | |
| tree | cceb57ce76da1f15e08a82ceb10ef7e8ecb8cfa7 /examples/get_camera_feature_values.py | |
| parent | ed8292a1427a422770c983bace843520b5da46a7 (diff) | |
| download | pymba-220fd5201be8d1a149abcf1637ed8bcc04123dfe.tar.gz pymba-220fd5201be8d1a149abcf1637ed8bcc04123dfe.zip | |
added new usage examples
Diffstat (limited to 'examples/get_camera_feature_values.py')
| -rw-r--r-- | examples/get_camera_feature_values.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/get_camera_feature_values.py b/examples/get_camera_feature_values.py new file mode 100644 index 0000000..89f1582 --- /dev/null +++ b/examples/get_camera_feature_values.py @@ -0,0 +1,27 @@ +from pymba import Vimba, VimbaException + + +if __name__ == '__main__': + + with Vimba() as vmb: + camera = vmb.camera(0) + camera.open() + + # get feature value via feature object + for feature_name in camera.feature_names(): + feature = camera.feature(feature_name) + + try: + value = feature.value + + # alternatively the feature value can be read as an object attribute + # value = getattr(camera, feature_name) + # or + # value = camera.someFeatureName + + except VimbaException as e: + value = e + + print(feature_name, '--', value) + + camera.close() |
