[mythtv] Using the python bindings
John Sutherland
garionphx at gmail.com
Tue Mar 11 15:39:18 UTC 2008
In the second sample, you are only importing the 'module' MythTV, but
not the class.. In the first, you're importing the MythDB class from
the MythTV module..
You could do (I know nothing about the myth python bindings, the code
may be incorrect..):
try:
import MythTV
mythtv = MythTV.MythTV()
except:
print "can't be initialized"
On Mar 11, 2008, at 5:39 AM, Ian Barton wrote:
> I have written a jabber bot to return various bits of info about my
> backend. It has been suggested that I should use the python bindings,
> rather than try to access the database directly.
>
> Can someone provide me with a bit of code that shows how to create an
> instance of the MyhtTV class? This is my first python program, so
> please
> excuse my stupidity:)
>
> If I write something like:
>
> try:
> from MythTV import MythDB
> mythdb = MythDB()
>
> except:
> print "MythDB module cannot be initialized"
>
> that works fine. However,
>
> try:
> import MythTV
> mythtv = MythTV()
>
> except:
> print "MythTV module cannot be initialized"
>
> throws an exception.
>
> Ian.
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
--John
More information about the mythtv-dev
mailing list