python 下载特定用户的所有要点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 下载特定用户的所有要点相关的知识,希望对你有一定的参考价值。

# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call

user = sys.argv[1]

r = requests.get('https://api.github.com/users/{0}/gists'.format(user))

for i in r.json():
	call(['git', 'clone', i['git_pull_url']])

	description_file = './{0}/description.txt'.format(i['id'])
	with open(description_file, 'w') as f:
		f.write('{0}\n'.format(i['description']))

以上是关于python 下载特定用户的所有要点的主要内容,如果未能解决你的问题,请参考以下文章

python 下载特定用户的所有要点

python 克隆或更新指定用户的所有要点

python 克隆或更新所有用户的要点#backup #github #gists #management

python 自动克隆我的所有要点(要点备份?)

python [Django]清除特定用户的所有会话

Python - 目录中特定文件夹的用户输入,然后打印目录的所有内容