-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGUI.py
More file actions
72 lines (55 loc) · 1.58 KB
/
GUI.py
File metadata and controls
72 lines (55 loc) · 1.58 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import sys
from PyQt4.QtCore import pyqtSlot
from PyQt4.QtGui import *
from data import *
# create our window
app = QApplication(sys.argv)
app.setWindowIcon(QIcon('home.png'))
w = QWidget()
w.setWindowTitle('Home Value Calculator')
# Create addressBox
addressBox = QLineEdit(w)
addressBox.setPlaceholderText("Address")
addressBox.move(20, 20)
addressBox.resize(280,30)
postalBox = QLineEdit(w)
postalBox.setPlaceholderText("Zip Code")
postalBox.move(20, 70)
postalBox.resize(280,30)
#Create Address Label
addressLabel = QLabel("Address: ", w)
addressLabel.move(310,20)
addressLabel.resize(330, 20)
#Create Value Label
value = QLabel("Value: ", w)
value.move(310,50)
value.resize(330,20)
#Create Realistic Value Label
realValueLabel = QLabel("Realistic Value: ", w)
realValueLabel.move(310,80)
realValueLabel.resize(330, 20)
#Create Bid Label
bidLabel = QLabel("Maximum Bid: ", w)
bidLabel.move(310,110)
bidLabel.resize(330, 20)
# Set window size.
w.setFixedSize(600, 210)
# Create a button in the window
button = QPushButton('Calculate', w)
button.move(20,170)
# Create the actions
@pyqtSlot()
def on_click():
address = addressBox.text()
zipCode = postalBox.text()
value.setText("Value: " + getResults(address, zipCode))
addressLabel.setText(getAddress(address, zipCode))
realValueLabel.setText("Realistic Value: $" + realisticSale(address, zipCode))
bidLabel.setText("Maximum Bid(@1.5x Profit): " + getMaxBid(address, zipCode))
#app.exit()
# connect the signals to the slots
button.clicked.connect(on_click)
# Show the window and run the app
w.setFocus()
w.show()
app.exec_()