#import code for encoding urls and generating md5 hashes
import urllib, hashlib
#Set your variables here
email = "someone@somewhere.com"
default = "http://www.somewhere.com/homsar.jpg"
size = 40
#construct the url
gravatar_url = "http://www.gravatar.com/avatar.php?"
gravatar_url += urllib.urlencode({'gravatar_id':hashlib.md5(email).hexdigest(),
'default':default,'size':str(size)})
gravatar_url即为用户someone@somewhere.com的头像路径~~
your blog is very good......