Ping in xbmc python?
#1
Lightbulb 
ok, just starting with python... i've made a very simple script which loads up a playlist off my computer on startup, randomizes it, etc, all works well... but if my computer is not on, it pops up a password dialog as if it's there but the password is not right. anyway what i want to do is ping my machine, if it responds, load the playlist, if it doesn't, play something off the hd. all very easy except how do i ping?

cheers for any help...
Reply
#2
to determine connection status you should just spin off a thread that tries to connect to the machine via a socket and have that thread timeout after a while. this is the way most scripts try to connect to a web site (my cnn script has an example).
Reply
#3
yep well i thought about doing that... pinging would be much easier & faster though if you ask me. plus of course you need to have some kinda server listening to a port on the machine. still doable though, i checked out your script, might implement it that way -- cheers.
Reply

Logout Mark Read Team Forum Stats Members Help
Ping in xbmc python?0