Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mbiette
mbiette / example_send_email_with_attachment.py
Created September 24, 2015 17:44
Simple python script to send an email with a csv attached
# coding=utf-8
__author__ = 'Maxime Biette'
conf = {
'from': 'maximebiette@gmail.com',
'to': 'maximebiette+test@gmail.com',
'server': 'smtp.gmail.com',
'port': '587',
'tls': 'yes',
'login': 'maximebiette@gmail.com',
@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: