-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtermOptions.py
45 lines (41 loc) · 1.35 KB
/
termOptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import datetime
now = datetime.datetime.now()
def termOptions():
#This function creates an array that includes the current term and 1 future term
terms = {}
fullyear = now.year
year = int(str(fullyear)[-2:])
month = now.month
for i in range(0,2):
if i == 0:
if month < 5:
terms["Winter "+str(fullyear)]="1"+str(year)+"1"
elif month < 9:
terms["Spring "+str(fullyear)]="1"+str(year)+"5"
else:
terms["Fall "+str(fullyear)]="1"+str(year)+"9"
if i == 1:
if month < 5:
terms["Spring "+str(fullyear)]="1"+str(year)+"5"
elif month < 9:
terms["Fall "+str(fullyear)]="1"+str(year)+"9"
else:
terms["Winter "+str(fullyear+1)]="1"+str(year+1)+"1"
return terms
def displayOptions():
#display the available terms
print("Select the term: ")
termDict = termOptions()
termList = list(termDict.keys())
print("1 - " + termList[0])
print("2 - " + termList[1])
def termselect(userIn):
#basic logic and input to test term selecter
termDict = termOptions()
termList = list(termDict.keys())
if userIn == "1":
termString = termList[0]
if userIn == "2":
termString = termList[1]
term = termDict.get(termString)
return term