Skip to content

Instantly share code, notes, and snippets.

@albertlai431
Last active May 17, 2019 11:28
Show Gist options
  • Save albertlai431/f6c9259acb05c5a865d45e4329f42d00 to your computer and use it in GitHub Desktop.
Save albertlai431/f6c9259acb05c5a865d45e4329f42d00 to your computer and use it in GitHub Desktop.
while True:
data, addr = sock.recvfrom(1024)
if 'alpha_absolute' in str(data):
#processing data here
#Gauging focus
if time.clock() - timer > 10:
measure = (sum(stock)/len(stock))/benchmark*100
if measure>100:
print("Focused : 100%")
elif measure>80:
print("Focused : ",measure,"%")
elif measure>50:
print("Semifocused: ",measure,"%")
else:
print("Distracted: ",measure,"%")
winsound.Beep(frequency, duration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment