forked from How45/Price_Tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
45 lines (34 loc) · 1.23 KB
/
app.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 os
import helper as hp
import page_retrival as page
def graphic(): # UI graphic of page
print("""
___ ____ __ ____ _ _ ___ __ _ _ ____ __ ____ ____
/ __)( _ \ / _\ ( _ \/ )( \ / __)/ \ ( \/ )( _ \ / _\ ( _ \( __)
( (_ \ ) // \ ) __/) __ ( ( (__( O )/ \/ \ ) __// \ ) / ) _)
\___/(__\_)\_/\_/(__) \_)(_/ \___)\__/ \_)(_/(__) \_/\_/(__\_)(____)
1. Create New Graph
2. Load Graph
3. Delete Graph
""")
user = int(input(": "))
return user
def main(): # Control of all UI
index = graphic()
if index == 1:
link_list, item_name, file_name = hp.get_links()
price_list, date = page.get_prices(link_list)
hp.initialise_data_graph(link_list, price_list, file_name, item_name, date)
hp.draw_graph(price_list, item_name, date)
elif index == 2:
print(os.listdir('following'))
name = input("Enter name of graph (without .csv): ")
hp.load(name)
elif index == 3:
print(os.listdir('following'))
name = input("Enter name of graph (without .csv): ")
hp.delete(name)
else:
print('ERROR: No key')
if __name__ == '__main__':
main()