简体   繁体   中英

Github repo results when using github3.py library

I'm looking through some of the user documentation for github3.py library.

I'm trying to list all of a user's repos.

If I use the code below, with gr = gh.repos.list().all() , I get the expected results.

But, if I use gr = gh.repos.list(user='username',type='all') , I get this error: <pygithub3.core.result.smart.Result object at 0x00000000033728D0>

Looking at the docs, this should work, but I'm new to Python and this library so I may be missing something??

#!/usr/bin/env python
from pygithub3 import Github
import requests

auth = dict(login="xxxx", user = "xxxx", token="xxxxx", repo="my-repo")
gh = Github(**auth)

gr = gh.repos.list().all()

print gr

Try this way:

from pygithub3 import Github

auth = dict(login="my-github-login", password="my-github-password")
g = Github(**auth)

print g.repos.list(user='user-whose-repos-I-want-to-get').all()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM