Apr-20-2020, 04:51 PM
Let say , I have repository called "Sample" in my GitHub and inside my repository i have a file named "demo.txt" or any format file.
How do I read the content of file which is in GitHub ?
Can i able to get the content from GitHub API , if it's so , what should i do to get my file content from GitHub using Python ?
I tried this following code but this doesn't work.
How do I read the content of file which is in GitHub ?
Can i able to get the content from GitHub API , if it's so , what should i do to get my file content from GitHub using Python ?
I tried this following code but this doesn't work.
from github import Github g = Github("<Access Token>") repo = g.get_user().get_repo("sample") a = repo.get_contents("demo.txt") print(a.text)