Skip to content

Instantly share code, notes, and snippets.

View alaudet's full-sized avatar

Al Audet alaudet

View GitHub Profile
@alaudet
alaudet / timelapse
Created July 7, 2014 18:48
Timelapse pictures using Picamera module.
# take snapshots to create a timelapse video
import time
import picamera
method = raw_input("Select timelapse in seconds or minutes (S or M):> ")
if "s" in method or "S" in method:
seconds = int(raw_input("Enter photo interval in seconds: >: "))
@alaudet
alaudet / graphing_csv_data
Last active November 29, 2019 08:51
Graphing two column csv file with matplotlib, numpy
#!/usr/bin/python
# Raspi-sump, a sump pump monitoring system.
# Al Audet
# http://www.linuxnorth.org/raspi-sump/
import time
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
@alaudet
alaudet / smtplib_gmail
Last active August 29, 2015 14:02
smtplib gmail
import smtplib
import string
def smtp_gmail():
username = "your smtp username here "
password = "your smtp password here"
smtp_server = "smtp.gmail.com:587"
email_from = "sender email"
email_to = "recipient email or wireless carrier sms #"
email_body = string.join((
@alaudet
alaudet / decimal_output
Last active August 29, 2015 14:02
Decimal output
import decimal
number = float(1.787654)
decimal.getcontext().prec = 2
dec_number = decimal.Decimal(number) * 1
print str(dec_number)