Skip to content

Instantly share code, notes, and snippets.

@wandernauta
Created November 16, 2010 19:51
Show Gist options
  • Save wandernauta/702379 to your computer and use it in GitHub Desktop.
Save wandernauta/702379 to your computer and use it in GitHub Desktop.
scavenger@versus:~/Public/wolfgang/components/schedules$ python test.py
Schedule 3074110572:
0 Ma 10:00 - 10:20
2 Wo 17:00 - 17:20
2 Wo 17:20 - 17:40
2 Wo 17:40 - 18:00
from models import *
someteach = Schedule()
someteach.parse(['0 Ma 9:00 - 11:00', '1 Di 15:00 - 16:00', '2 Wo 00:00 - 20:00'])
somestudent = Schedule()
somestudent.parse(['0 Ma 10:00 - 10:20', '2 Wo 17:00 - 18:00'])
st_block = someteach.blockset()
ss_block = somestudent.blockset()
isct = st_block.intersection(ss_block)
result = Schedule()
result.fromset(isct)
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment