Skip to content

Instantly share code, notes, and snippets.

@alfredfrancis
Created February 21, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredfrancis/c97a59438dc63acc5188 to your computer and use it in GitHub Desktop.
Save alfredfrancis/c97a59438dc63acc5188 to your computer and use it in GitHub Desktop.
def doAction(str2):
words = str2.split()
if words[0] == 'set':
a = re.compile(' set an alarm for (\w+ \w*) (am|pm)')
m = a.match(str2)
if m:
print(m.group(1), m.group(2))
setAlarm(m.group(1), m.group(2))
else:
print(str2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment