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
# Imports go at the top | |
# Send Code | |
from microbit import * | |
import radio | |
radio.config(group=23) | |
radio.on() | |
while True: |
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 sense_hat import SenseHat github.com/STJRush | |
sense = SenseHat() | |
sense.clear() | |
temp = sense.get_temperature() | |
print(temp) | |
""" | |
############################################################# |
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 sense_hat import SenseHat | |
sense = SenseHat() | |
sense.set_rotation(270) | |
sense.show_message("Hi") | |
humidity = round( sense.get_humidity(), 1 ) | |
sense.show_message( "Humidity now is " + str(humidity) +"%" ) |
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 the multiple libraries needed | |
from logzero import logger, logfile | |
from ephem import readtle, degree | |
from picamera import PiCamera | |
from datetime import datetime, timedelta | |
from time import sleep | |
from pathlib import Path | |
import csv | |
# directory to 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
""" | |
## I've commented out the first part of this code as it's the last bit that does the writing to a .csv file. The first bit cleans it. | |
import csv | |
import re | |
#"valu" should be a string going into the function to get cleaned | |
def clean_stuff(valu): |
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
#cleanstart | |
# xTitle yTitle x1 y1 x2 y2 x3 y3 etc... | |
dataListed = [['#Student', 'sCore.'], ['Mr. Joer', '2 points'], ['Lad John', 'Six'], ['Mr. Jimmy', '2%'], ['Legend James', '3.0'], ['Miss Jane', '4']] | |
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
#example 1 | |
def make_foodz(): | |
your_pasta=input("What kind of pasta would you like?") | |
print("Sure, I'll make you some delicous", your_pasta) | |
#return your_pasta | |
#program starts here |
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 winsound | |
#List of mistakes I have made using winsound: | |
######################################################################## | |
# I hear nothing? | |
######################################################################## | |
winsound.PlaySound("", winsound.SND_FILENAME) | |
#You hear nothing because you're missing your sound name |
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 pandas | |
import tsp #traveling salesman | |
mat = [[ 0, 128, 75, 95], | |
[ 128, 0, 105, 160], | |
[ 75, 105, 0, 120], | |
[95, 160, 120, 0]] # Distance Matrix | |
r = range(len(mat)) | |
# Dictionary of distance | |
dist = {(i, j): mat[i][j] for i in r for j in r} |
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 time import sleep | |
print ("Here is a wonderful tune for the lads and whamen") | |
sleep(1.5) | |
while True: | |
print("Death to America") | |
sleep(1.5) | |
print("And butter sauce") | |
sleep(1.5) | |
print("Don't boil me") |
NewerOlder