Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #/home/cpcmonster/bin/lecture_dates_2012_01.py
- # Released under a GPLv3 Licence by Clockwork PC 2011
- # www.clockworkpc.com.au
- # You are entitled to the following four freedoms:
- # Freedom 0: To run this program for any purpose
- # Freedom 1: To study how this program works and change it to make it do what you wish
- # Freedom 2: To redistribute copies so you can help your neighbour
- # Freedom 3: To distribute copies of your modified version to others
- import os
- #Subject Details
- lCode = raw_input("What is the code of this subject? ")
- lName = raw_input("What is the name of this subject? ")
- lTitle = lCode + " " + lName
- l1Title = lCode + " L1 " + lName
- l2Title = lCode + " L2 " + lName
- lRepeat = "for 12 weeks"
- print ""
- print "This subject is called " + lTitle
- print ""
- #First Lecture Details
- l1DayInput = input("""What day is the first lecture?
- 1. Monday
- 2. Tuesday
- 3. Wednesday
- 4. Thursday
- 5. Friday
- 6. Saturday
- 7. Sunday
- """)
- if l1DayInput == 1:
- l1Day = "every Monday"
- elif l1DayInput == 2:
- l1Day = "every Tuesday"
- elif l1DayInput == 3:
- l1Day = "every Wednesday"
- elif l1DayInput == 4:
- l1Day = "every Thursday"
- elif l1DayInput == 5:
- l1Day = "every Friday"
- elif l1DayInput == 6:
- l1Day = "every Saturday"
- elif l1DayInput == 7:
- l1Day = "every Sunday"
- print "The first lecture takes place on " + l1Day
- l1StartingTime = input("""What is the duration of this lecture?
- 1. 10:00-12:00
- 2. 11:00-13:00
- 3. 12:00-14:00
- 4. 13:00-15:00
- 5. 14:00-16:00
- 6. 15:00-17:00
- 7. 16:00-18:00
- 8. 17:00-19:00
- 9. 18:00-20:00
- """)
- if l1StartingTime == 1:
- l1Duration = "10:00-12:00"
- elif l1StartingTime == 2:
- l1Duration = "11:00-13:00"
- elif l1StartingTime == 3:
- l1Duration = "12:00-14:00"
- elif l1StartingTime == 4:
- l1Duration = "13:00-15:00"
- elif l1StartingTime == 5:
- l1Duration = "14:00-16:00"
- elif l1StartingTime == 6:
- l1Duration = "15:00-17:00"
- elif l1StartingTime == 7:
- l1Duration = "16:00-18:00"
- elif l1StartingTime == 8:
- l1Duration = "17:00-19:00"
- elif l1StartingTime == 9:
- l1Duration = "18:00-20:00"
- else:
- print "wrong input"
- l1Location = raw_input("Where is the lecture? ")
- l1Theatre = "at " + l1Location
- l1Schedule = l1Title + " " + l1Theatre + " " + l1Duration + " " + lRepeat + " " + l1Day
- print ""
- print l1Schedule
- print ""
- #Second Lecture Details
- l2DayInput = input("""What day is the second lecture?
- 1. Monday
- 2. Tuesday
- 3. Wednesday
- 4. Thursday
- 5. Friday
- 6. Saturday
- 7. Sunday
- """)
- if l2DayInput == 1:
- l2Day = "every Monday"
- elif l2DayInput == 2:
- l2Day = "every Tuesday"
- elif l2DayInput == 3:
- l2Day = "every Wednesday"
- elif l2DayInput == 4:
- l2Day = "every Thursday"
- elif l2DayInput == 5:
- l2Day = "every Friday"
- elif l2DayInput == 6:
- l2Day = "every Saturday"
- elif l2DayInput == 7:
- l2Day = "every Sunday"
- print ""
- print "The second lecture takes place on " + l2Day
- print ""
- l2StartingTime = input("""What is the duration of this lecture?
- 1. 10:00-12:00
- 2. 11:00-13:00
- 3. 12:00-14:00
- 4. 13:00-15:00
- 5. 14:00-16:00
- 6. 15:00-17:00
- 7. 16:00-18:00
- 8. 17:00-19:00
- 9. 18:00-20:00
- """)
- if l2StartingTime == 1:
- l2Duration = "10:00-12:00"
- elif l2StartingTime == 2:
- l2Duration = "11:00-13:00"
- elif l2StartingTime == 3:
- l2Duration = "12:00-14:00"
- elif l2StartingTime == 4:
- l2Duration = "13:00-15:00"
- elif l2StartingTime == 5:
- l2Duration = "14:00-16:00"
- elif l2StartingTime == 6:
- l2Duration = "15:00-17:00"
- elif l2StartingTime == 7:
- l2Duration = "16:00-18:00"
- elif l2StartingTime == 8:
- l2Duration = "17:00-19:00"
- elif l2StartingTime == 9:
- l2Duration = "18:00-20:00"
- else:
- print "wrong input"
- l2Location = raw_input("Where is the lecture? ")
- l2Theatre = "at " + l2Location
- l2Schedule = l2Title + " " + l2Theatre + " " + l2Duration + " " + lRepeat + " " + l2Day
- print ""
- print l2Schedule
- print ""
- # Google Calendar Code
- print ""
- print "Google Calendar Code"
- print ""
- os.system("google calendar add " + '"' + l1Schedule +'"')
- os.system("google calendar add " + '"' + l2Schedule +'"')
- os.system("xcowsay 'Your calendars for " + l1Title + " and " + l2Title + " have been generated :)'")
Add Comment
Please, Sign In to add comment