aboutsummaryrefslogtreecommitdiff
path: root/examples/get_interface_feature_values.py
blob: fbb59b44aca1abbbcf171bc52cfaeb63180585d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from pymba import Vimba, VimbaException


if __name__ == '__main__':

    with Vimba() as vimba:
        interface = vimba.interface(0)
        interface.open()

        # get feature value via feature object
        for feature_name in interface.feature_names():
            feature = interface.feature(feature_name)

            try:
                value = feature.value

                # alternatively the feature value can be read as an object attribute
                # value = getattr(interface, feature_name)
                # or
                # value = interface.someFeatureName

            except VimbaException as e:
                value = e

            print(feature_name, '--', value)

        interface.close()