I'm trying to access the language used in each repository given a Github username. In order to do this, so far my python code is:
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
However, the list object apparently doesn't have any language attribute, so I don't know how to access that information. Does anyone have any help?
解决方案
Try this man, it worked for me:
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