python获取微信公众号Access_Token
2015-06-16获取微信公众号Access_Token
#!/usr/bin/python
import sys
import urllib2
import simplejson
Appid="你的微信公众号Appid"
Appsecret="你的微信公众号Appsecret"
url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s" % (Appid,Appsecret)
result=urllib2.urlopen(url).read()
access_token=simplejson.loads(result).get('access_token')
print 'access_token===%s' % (access_token)
实例:./get_token.py
access_token===KY0_yicsKX1608kH4H1LQgYCS0FNsADka6fHJ5H6VLPlpvMprFwCxewAnp_fMH3vigPJJJp0d6j-970XU3LsaCkqaOyOl41SHyCzyML06M1