Documentation is horrible for PyGitHub, but the product is great. Here is a quick sample for actually retrieving a file, changing it with a new comment at the beginning of the file and committing it back
from github import Github
gh = Github(login_or_token='.....', base_url='...../api/v3')
user = gh.get_user()
repo = user.get_repo("RepoName")
file = repo.get_file_contents("/App/forms.py")
decoded_content = "# Test " + "\r\n" + file.decoded_content
repo.update_file("/"RepoName"/forms.py", "Commit Comments", decoded_content, file.sha)