aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index ed66728..2287097 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,13 @@ pymba is a Python wrapper for the Allied Vision Technologies (AVT) Vimba C API.
## Usage
+### Typical usage
+
+The following code gives a good example of basic pymba usage. For clarity exceptions are not dealt with.
+
from pymba.Vimba import Vimba
from pymba.VimbaFrame import VimbaFrame
from pymba.VimbaCamera import VimbaCamera
- from pymba.VimbaException import VimbaException
# start Vimba
vimba = Vimba()
@@ -76,3 +79,17 @@ pymba is a Python wrapper for the Allied Vision Technologies (AVT) Vimba C API.
# shutdown Vimba
vimba.shutdown()
+
+
+### Handling Vimba exceptions
+
+Handling exceptions can be done as shown below.
+
+ from pymba.Vimba import Vimba
+ from pymba.VimbaException import VimbaException
+
+ try:
+ vimba = Vimba()
+ vimba.startup()
+ except VimbaException as e:
+ print e.message