From 5398c7943f15db06ade9213ab2ec10ee7f8e2eff Mon Sep 17 00:00:00 2001 From: limafresh Date: Sun, 27 Oct 2024 11:55:41 +0200 Subject: [PATCH] If the result is zero, then the string displays zero instead of an empty string --- pyproject.toml | 2 +- src/pyqulator/create_shortcut.py | 2 +- src/pyqulator/main.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2fe5aee..7929437 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyqulator" -version = "1.7.0" +version = "1.7.1" dependencies = [ "PyQt6>=6.4.2", "sympy>=1.13.3", diff --git a/src/pyqulator/create_shortcut.py b/src/pyqulator/create_shortcut.py index 9151795..d460b42 100644 --- a/src/pyqulator/create_shortcut.py +++ b/src/pyqulator/create_shortcut.py @@ -38,7 +38,7 @@ def main(): with open(destination, "w") as desktop_file: desktop_file.write(desktop_content) - print(f"Shortcut created!") + print("Shortcut created!") except Exception as e: print(f"Shortcut was not created: {e}") else: diff --git a/src/pyqulator/main.py b/src/pyqulator/main.py index 1995728..0921fab 100644 --- a/src/pyqulator/main.py +++ b/src/pyqulator/main.py @@ -207,6 +207,8 @@ def calculate(self): self.ui.journal.addItem(f"{expression} = {res}") except Exception as e: QMessageBox.warning(self, "Error", str(e)) + if self.current_line_result.text() == "": + self.current_line_result.setText("0") # Clear result line def clear_line_result(self):