Created
July 20, 2017 22:47
-
-
Save Jan200101/ebcc0bbca4e502d0563f793b280b326f to your computer and use it in GitHub Desktop.
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 toaster | |
import os | |
import time | |
try: | |
toaster.init() | |
except: | |
print('No Toaster was found') | |
exit() | |
if len(toast.devices) > 1: | |
print('More then one toaster is connected.\nDisconnected one Toaster and restart this script') | |
exit() | |
if not toast.devices[0].working: | |
if os.name == 'nt': | |
os.system('cls') | |
else: | |
os.system('clear') | |
print('Put your toast in.\nDisplaying a message once its one!') | |
while not toast.devices[0].working: | |
time.sleep(0.9) | |
while toast.devices[0].working: | |
time.sleep(0.9) | |
if not toast.devices[0].working: | |
if os.name == 'nt': | |
os.system('cls') | |
else: | |
os.system('clear') | |
print('TOAST IS READY') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment