def print_init(): """Print a message to indicate that the machine has restarted. """ try: r = requests.get("https://api.ipify.org") ip = r.text printer.print_message("I'm Alive!" + "\n" + ip) except: printer.print_message("I'm Alive!\nNo Network :'(")
def main_loop(): ser = serial.Serial(SERIAL_PORT, BAUD) while True: ser.flushInput() time.sleep(0.1) msg = ser.readline().decode().strip() if msg != "": lolcode = users.get_lolcode(msg) kerb = users.get_kerb(lolcode) print("LOLcode:", lolcode) if kerb: printer.print_label(kerb, datetime.datetime.now()) else: printer.print_message("LOLcode: " + lolcode + "\nBring this to Shreyas!") ser.flushInput() time.sleep(DELAY)
def _join(donations, contacts, config): data = donations.merge(contacts, how="outer", on="PeopleID") print_message("- Donations and contacts merged", config) return data
def _load_donations(config): donations = pandas.read_csv(config["inputs"]["donations"] + "Donation_April_2020.csv") print_message("- Donations data loaded", config) return donations
def _load_contacts(config): contacts = pandas.read_csv(config["inputs"]["contacts"] + "Contact_April_2020.csv") print_message("- Contacts data loaded", config) return contacts