This file contains hidden or 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 csv | |
| from datetime import datetime | |
| from collections import OrderedDict | |
| import matplotlib.pyplot as plt | |
| # set up empty containers | |
| total = 0 | |
| months = dict() | |
| # open and read CSV |
This file contains hidden or 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 csv | |
| from statistics import mean | |
| # set up empty dict containers | |
| associate_type = dict() # row 6 | |
| associate_from = dict() # row 7 | |
| maths = dict() # row 14 | |
| advisors = dict() # row 15 | |
| # set up empty list containers |
This file contains hidden or 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 picamera import PiCamera, Color | |
| from time import sleep | |
| from datetime import datetime as dt | |
| with PiCamera() as camera: | |
| camera.rotation = 180 # omit or use 90, 180, 270 depending on setup | |
| camera.annotate_background = Color("black") | |
| start = dt.now() | |
| camera.start_preview() |
This file contains hidden or 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
| # enable less secure apps in gmail before sending | |
| import os | |
| import smtplib | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.image import MIMEImage | |
| # gather inputs | |
| from_addr = input("FROM ADDRESS: ") | |
| pwd = input("PASSWORD: ") |
This file contains hidden or 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
| # Python Standard Library | |
| import smtplib | |
| import ssl | |
| import webbrowser | |
| from datetime import datetime as dt | |
| from email.mime.text import MIMEText | |
| from time import sleep | |
| from urllib.request import urlopen | |
| # Third-party |
This file contains hidden or 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
| # Builds on the random daily Stoic meditation gist at: | |
| # https://gist.github.com/AO8/a33b0e70a1885679279f0533d4f5d8dc | |
| # Enable less secure apps in gmail before running | |
| import random | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| from datetime import datetime, timedelta | |
| from time import sleep |
This file contains hidden or 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
| # Builds on the random daily Stoic meditation gist at: | |
| # https://gist.github.com/AO8/a33b0e70a1885679279f0533d4f5d8dc | |
| # Enable less secure apps in gmail before attempting to send | |
| import random | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| from datetime import datetime | |
| random.seed(datetime.now()) |
This file contains hidden or 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 csv | |
| import matplotlib.pyplot as plt | |
| months = { | |
| "january" : 0, | |
| "february" : 0, | |
| "march" : 0, | |
| "april" : 0, | |
| "may" : 0, | |
| "june" : 0, |
This file contains hidden or 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 csv | |
| from collections import Counter | |
| import matplotlib.pyplot as plt | |
| # set up empty containers | |
| leads = Counter() | |
| email_addresses = set() | |
| total_rows = 0 # storing total rows in csv if useful outside of plot | |
| # ignores 'Other' entries; 'Other' since removed from appt booking question |
This file contains hidden or 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
| # Inspired from a recent re-reading of Meditations by Marcus Aurelius, translation by Gregory Hays. | |
| import random | |
| import textwrap | |
| with open("meditations.txt", "r") as f: | |
| contents = f.readlines() | |
| def ask_stoic(): | |
| prompt = input("Would you like a stoic meditation? y or n ") |