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/interface/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/interface/set_feature_value.py')
| -rw-r--r-- | examples/interface/set_feature_value.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/interface/set_feature_value.py b/examples/interface/set_feature_value.py new file mode 100644 index 0000000..0c71da2 --- /dev/null +++ b/examples/interface/set_feature_value.py @@ -0,0 +1,22 @@ +from pymba import Vimba + + +if __name__ == '__main__': + + with Vimba() as vimba: + interface = vimba.interface(0) + interface.open() + + # set a feature value by feature name + feature = interface.feature('InterfacePingPace') + 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 + interface.InterfacePingPace = 3 + + interface.close() |
