This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import time | |
from datetime import datetime | |
print("Starting ...") | |
# change the port to whichever shows in Arduino | |
tardis = serial.Serial('/dev/ttyACM0', baudrate=9600) | |
while(1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from LSM6DS3 import * | |
from time import sleep | |
from grove_rgb_lcd import * | |
import grovepi | |
# this is the chip the sensor is based on | |
mySensor = LSM6DS3() | |
# two buttons attached to digital 3 and 4 | |
grovepi.pinMode(3, "INPUT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import requests | |
import pyperclip | |
# did the user supply an image file? | |
if len(sys.argv) == 2: | |
image = sys.argv[1] | |
else: | |
input("You must supply an image file!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# these modules help us do the script | |
import html2text | |
import requests | |
import sys | |
# this is the important library that acutally does the work | |
from textstat.textstat import textstat | |
with open('testfile.txt', 'r') as content_file: | |
test_string = content_file.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import discord | |
import subprocess | |
# discord client | |
client = discord.Client() | |
def process_message(message): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# these modules help us do the script | |
import html2text | |
import requests | |
import sys | |
# this is the important library that acutally does the work | |
from textstat.textstat import textstat | |
# this is an easy way to strip html | |
h = html2text.HTML2Text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
# discord client | |
client = discord.Client() | |
# create a new event | |
@client.event | |
async def on_ready(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
from PIL import Image | |
# get all the jpg files from the current folder | |
for infile in glob.glob("*.jpg"): | |
im = Image.open(infile) | |
# convert to thumbnail image | |
im.thumbnail((128, 128), Image.ANTIALIAS) | |
# don't save if thumbnail already exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// libraries for i2c and the specific display | |
#include <Wire.h> | |
#include "rgb_lcd.h" | |
rgb_lcd lcd; | |
void setup() { | |
// make sure the random is random | |
randomSeed(analogRead(0)); |