我正在尝试通过给定 Github 用户名来访问每个存储库中使用的语言。为了做到这一点,到目前为止我的Python代码是:
from pygithub3 import Github
username = raw_input("Please enter a Github username: ")
password = raw_input("Please enter the account password: ")
gh = Github(login=username, password = password)
get_user = gh.users.get()
user_repos = gh.repos.list().all().language
print user_repos
但是,列表对象显然没有任何语言属性,因此我不知道如何访问该信息。有人有帮助吗?
试试这个人,它对我有用:
from pygithub3 import Github
username = raw_input("Please enter a Github username: ")
password = raw_input("Please enter the account password: ")
gh = Github(login=username, password = password)
get_user = gh.users.get()
user_repos = gh.repos.list().all()
for repo in user_repos:
print repo.language
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)