diff options
| author | morefigs <morefigs@gmail.com> | 2019-02-21 12:10:55 +1100 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2019-02-21 12:10:55 +1100 |
| commit | 712b3789a1d961661e4076846a2d33a2e830a41e (patch) | |
| tree | 2b1e7c309b7ed6b789fa0a5176a87f9ed82ee9a4 /examples/camera/set_feature_value.py | |
| parent | edbbf80d3e8b981cc71cd61f85fd14d0effd3e88 (diff) | |
| download | pymba-712b3789a1d961661e4076846a2d33a2e830a41e.tar.gz pymba-712b3789a1d961661e4076846a2d33a2e830a41e.zip | |
calling an object command feature type as an attribute returns a callable
Diffstat (limited to 'examples/camera/set_feature_value.py')
| -rw-r--r-- | examples/camera/set_feature_value.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/camera/set_feature_value.py b/examples/camera/set_feature_value.py new file mode 100644 index 0000000..77f8ce5 --- /dev/null +++ b/examples/camera/set_feature_value.py @@ -0,0 +1,22 @@ +from pymba import Vimba + + +if __name__ == '__main__': + + with Vimba() as vimba: + camera = vimba.camera(0) + camera.open() + + # read a feature value + feature = camera.feature('ExposureAuto') + value = feature.value + + # set the feature value + feature.value = value + + print(feature.name, '=', feature.value) + + # alternatively the feature value can be set as an object attribute + camera.ExposureAuto = feature.value + + camera.close() |
