From 8b52ddeceaa6e447d5a0bcbee29ec3a202791b86 Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Mon, 23 Sep 2024 01:46:38 -0400 Subject: [PATCH] fix easy problem error and adjust spacing --- GUI.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/GUI.py b/GUI.py index 18614a3..be676e8 100644 --- a/GUI.py +++ b/GUI.py @@ -228,12 +228,14 @@ def __init__(self): self.result.setMargin(10) hlayout = QHBoxLayout() - hlayout.addStretch() + #hlayout.addStretch() + hlayout.addSpacing(100) vlayout = QVBoxLayout() vlayout.addWidget(self.line_edit) vlayout.addWidget(self.result) hlayout.addLayout(vlayout) - hlayout.addStretch() + #hlayout.addStretch() + hlayout.addSpacing(100) self.layout.addLayout(hlayout) @@ -253,7 +255,8 @@ def keyPressEvent(self, event): if '=' in self.line_edit.text() and not self.line_edit.text().endswith("="): self.result.setText(compute(self.line_edit.text())) elif self.line_edit.text()=='': - self.result.setText(get_outcome()) + formula = input_sequence + '+x=' + output_sequence + self.result.setText(compute(formula)) else: if self.line_edit.text().endswith("="): formula = input_sequence + '+' + self.line_edit.text() + output_sequence