Whats is the python urllib equivallent of 

```
curl -u username:password status="abcd" http://example.com/update.json

```

I did this:

```
handle = urllib2.Request(url)
authheader =  "Basic %s" % base64.encodestring('%s:%s' % (username, password))
handle.add_header("Authorization", authheader)

```

Is there a better / simpler way?