Getting repository information using pygithub3 for Python

后端 未结 2 1312
感动是毒
感动是毒 2021-01-29 03:57

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

         


        
2条回答
  •  清歌不尽
    2021-01-29 04:40

    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
    

提交回复
热议问题