Not that experienced with python.  This was the way I got it working ;).  If there's another way to do it, plz modify it.