From 1b5055c07553d18e6f241d848423d8e79691edbb Mon Sep 17 00:00:00 2001 From: morefigs Date: Tue, 2 Apr 2013 15:15:04 +1200 Subject: Update README.md --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3