This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myJsonify(json: any, level = 0): string { | |
let result = ''; | |
if (Array.isArray(json)) { | |
result += "[\n"; | |
for (const item of json) { | |
for (let i = 0; i < level * 2 + 2; i++) { | |
result += ' '; | |
} | |
result += `${myJsonify(item, level + 1)},\n`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests as rq | |
import json | |
# 获取 access_token | |
url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=YOUR_APP_ID&secret=YOUR_SECRET' | |
res = rq.get(url) | |
json = res.json() | |
access_token = json['access_token'] | |
# print(access_token) |