-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (24 loc) · 800 Bytes
/
Copy pathmain.py
File metadata and controls
27 lines (24 loc) · 800 Bytes
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
from makeDB import writeDB, loadDB
from queries import parse, readFile
def main():
FINAL = "final"
printWelcome()
data = input("Enter the location of the data file: ")
writeDB(data,FINAL)
print("Database written.")
query = " "
while query != "":
query = input("Enter query: ")
if query == 'r':
q = input("Enter location of query file: ")
readFile(q)
elif query != "":
parse(query)
def printWelcome():
print("-------------------------------------------------------")
print("----------- Welcome to SmallDB - NOSQL Database -------")
print()
print(" Enter an empty query to quit. ")
print(" Type r to load a query file ")
print()
main()