python: Abyss Webserver start and stop host from CLI

Translation of the original in Catalan. Read it in: CatalàCastellano

Little script in python to start/stop the Abyss Webserver from the command line. We just have to put the URL where the Abyss console website is and the user and password to get in. Since it's done quickly and in a rush, passing parameters to indicate whether the service should be started and/or stopped at each moment is not supported. So if anyone feels like adding the 4 lines of code that are missing, let me know, because I don't master python well enough to do it in 1s yet and today I'm already tired.

import urllib2
<br>
theurl = 'http://127.0.0.1:9999'
username = 'theuser'
password = 'thepass'
<br>
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, theurl, username, password)
authhandler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(authhandler)
<br>
data_start = "%2Fhosts%2Fhost%400%2Fstart=Start"
data_stop = "%2Fhosts%2Fhost%400%2Fstop=Stop"
<br>
data = data_start
<br>
request = urllib2.Request(theurl,data)
response = opener.open(request)
<br>
print response.readlines()