There are multiple ways to gist full source code in Python, but one of the easiest and most popular method is by using the requests module to interact with the Github API. Here are the steps:
Install requests module by executing pip install requests in your terminal.
Import the requests module.
main.py16 chars2 lines
main.py83 chars3 lines
main.py77 chars3 lines
public to False if you want to keep the gist to yourself.main.py131 chars9 lines
requests.post() method.main.py56 chars2 lines
main.py176 chars7 lines
That's it! You have just gisted your Python source code using the Github API in Python. Remember to use version control for your code and to keep your authentication credentials secret.
gistlibby LogSnag