Skip to content

Instantly share code, notes, and snippets.

View robinroy03's full-sized avatar
💫
Building

Robin Roy robinroy03

💫
Building
View GitHub Profile
@HarishChandran3304
HarishChandran3304 / venv.md
Created October 3, 2023 12:01
Cheat sheet for python venv commands

Python Venv Cheat Sheet

Create a new venv:

$ python3 -m venv venv

Activate venv:

$ source ./venv/bin/activate
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200: