2005-03-06, 03:01
hey i've been trying to make a script that views live webcam images from the internet with no luck. i'm a complete newbie to python.
i found this code on this forum and have been trying to get it to work, but when i try to run it nothing happens at all:
can anyone help me fix this? all i want is for the image to download and display every x seconds!
- mike
i found this code on this forum and have been trying to get it to work, but when i try to run it nothing happens at all:
Quote:import urllib
import xbmc
import xbmcgui
action_menu = 10
root_dir = "q:\\scripts\\cache\\"
url_webcam = 'http://www.tcomeng.com/webcams/emeraldhills.jpg'
class webcam(xbmcgui.window):
def (self):
imgpath = root_dir + 'webcam.jpg'
loc = urllib.urlopener()
loc.retrieve(url_webcam, imgpath)
self.addcontrol(xbmcgui.controlimage(100, 100, 0, 0, imgpath))
def onaction(self, action):
if action == action_menu:
self.close()
win = webcam()
win.domodal()
del win
can anyone help me fix this? all i want is for the image to download and display every x seconds!
- mike