Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyGithub教程中的勘误(也可能是我的设备原因?) #58

Open
muiyu opened this issue Jan 18, 2024 · 3 comments
Open

PyGithub教程中的勘误(也可能是我的设备原因?) #58

muiyu opened this issue Jan 18, 2024 · 3 comments

Comments

@muiyu
Copy link

muiyu commented Jan 18, 2024

System Enviroment:
OS: Windows11, CPU: AMD R7, Python3.10

Problem:
image
如上图。前文应该已经填入了token值,此时若依然使用Github("token")来初始化这个类,我的设备上会报错,如下:
image
image
如果更正为Github(token),则可正常运行:
image

@TreeECNU
Copy link

TreeECNU commented Jan 18, 2024

Github()括号里面应该填你的token的那串字符串,如果你前面定义了token="***"(*表示你的token的具体内容),那么此时token已经变成了字符串,就直接Github(token)就行了。
注释的原意应该是让你直接把token中的内容填入Github()的括号中,即Github("***")(*表示你的token的具体内容)。

@thirstylearning
Copy link

token在你初始化中的含义是一个代表你认证信息的一个字符串变量,所以将token输入Github()类,可以使用你的认证信息,但如果在token的前后加上了“”就变成了输入的值是字符串“token”,这作为你的认证信息,这样原有的意思就变化了。

@Gnociew
Copy link

Gnociew commented Jan 18, 2024

如果之前定义了token的值,后面只要写token直接引用就行,写“token”代表你输入的字符串是token这几个字母

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants