diff options
| author | morefigs <morefigs@gmail.com> | 2013-04-02 15:15:04 +1200 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2013-04-02 15:15:04 +1200 |
| commit | 1b5055c07553d18e6f241d848423d8e79691edbb (patch) | |
| tree | efa69134f953cdbfb7f6681c08ce961980306467 /README.md | |
| parent | 72f90fff54b9e2cc1cb7aa21a8088f09a84fff04 (diff) | |
| download | pymba-1b5055c07553d18e6f241d848423d8e79691edbb.tar.gz pymba-1b5055c07553d18e6f241d848423d8e79691edbb.zip | |
Update README.md
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 |
