-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproject.py
More file actions
56 lines (34 loc) · 1.35 KB
/
Copy pathproject.py
File metadata and controls
56 lines (34 loc) · 1.35 KB
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
46
47
48
49
50
51
52
53
#CSE 412 Final Project
import psycopg2
import PySimpleGUI as sg
import imageManager
import songManager
import podcastManager
import reccomendationEngine
sg.theme('SandyBeach')
DB_HOST = "localhost"
DB_NAME = "DemoDb"
DB_USER = "postgres"
DB_PASS = #Redacted
conn = psycopg2.connect(dbname = DB_NAME, user= DB_USER, password = DB_PASS, host = DB_HOST)
cur = conn.cursor()
coverPictureUrl = "https://i0.wp.com/liveforlivemusic.com/wp-content/uploads/2016/02/musicbrain.jpg?fit=610%2C439&ssl=1"
imageBox = imageManager.ImageManager.create_image(coverPictureUrl, False)
layout = [[sg.Text("CSE 412 Project: Music Reccomendation Engine")],
[imageBox],[sg.Button("Find Songs", key = "Songs"), sg.Button("Find Podcasts", key = "Podcasts"), sg.Button("Get Reccomendations", key = "Reccomendations" )]]
window = sg.Window('', layout,
ttk_theme='clam',
resizable=True)
while True:
event, values = window.read()
print(event, values)
if event == sg.WIN_CLOSED:
break
if event == "Songs":
songManager.SongManager.open_song_table(cur, conn)
if event == "Podcasts":
podcastManager.PodcastManager.open_podcast_table(cur, conn)
if event == "Reccomendations":
reccomendationEngine.ReccomendationEngine.open_reccomendation_window(cur, conn)
cur.close()
conn.close()