написал программку для создания гистов. Делаю все по
документации, но не работает. В чем проблема?
from github import Github, InputFileContent
# using an access token
g = Github("тут токен")
user = g.get_user()
gist = user.create_gist(
public=bool(input('public [True/False]: ')),
files=InputFileContent(
open(input('file_path: ')).read(),
input('name: ')
),
description=input('description: ')
)
print(gist)
ошибка:
PS D:\codes> & D:/Programs/Python/python.exe d:/codes/ъыъ/gist_loader/github_.py
public [True/False]: True
file_path: D:\codes\ъыъ\gist_loader\main.py
name: ttteeeesssstttt.py
description: -
Traceback (most recent call last):
File "d:\codes\ъыъ\gist_loader\github_.py", line 7, in <module>
gist = user.create_gist(
File "D:\Programs\Python\lib\site-packages\github\AuthenticatedUser.py", line 563, in create_gist
isinstance(element, github.InputFileContent) for element in files.values()
AttributeError: 'InputFileContent' object has no attribute 'values'
доки:
create_gist()
InputFileContent()