This script lets you create a file in your python repository and the retrieve the content of the file.
from credentials import * from github import Github import requests # username = "....."" # password = "....." g = Github(username, password) repo = g.get_user().get_repo("formazione.github.io") # repo.create_file("memo.txt", "first memo", "We did it") memo = repo.get_contents("memo.txt") # print(memo.raw_data) html = memo.raw_data["_links"]['html'] html = html.replace("https://github.com", "").replace("blob/","") link = "https://raw.githubusercontent.com" + html t = requests.get(link) print(t.text)
Live video coding to create a text in github with python and the get back the content
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame