Danke für Deine Antwort.
Würdest Du im konkreten Fall dann eine eigene, neue Exception werfen, oder einfach die aktuelle weiterreichen?
Code: Alles auswählen
IP = '192.168.1.2'
ADDRESS = 'http://{0}:8181/tclrega.exe'.format(IP)
def send_hm_command(command):
try:
url_response = urllib2.urlopen(ADDRESS, command)
except urllib2.URLError:
raise
response = url_response.read()
if response.find('<xml>'):
return response.split('<xml>')[0]
Gruß,
Daniel