From 2d2d564840b36f6fbde82f727108ba6a44734521 Mon Sep 17 00:00:00 2001 From: Joshua Steer <joshua.w.steer@gmail.com> Date: Mon, 18 Mar 2019 13:32:45 +0000 Subject: [PATCH] Created exception for when point not selected in GUI --- GUIs/AmpScanGUI.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GUIs/AmpScanGUI.py b/GUIs/AmpScanGUI.py index 92523b4..08465e9 100644 --- a/GUIs/AmpScanGUI.py +++ b/GUIs/AmpScanGUI.py @@ -88,9 +88,13 @@ class AmpScanGUI(QMainWindow): return moving = str(self.alCont.moving.currentText()) self.files[moving].save(fname[0]) - if self.pnt is not None: + try: + self.pnt f = open(fname[0]+'.txt','w+') f.write('Picked Coordinates = {}'.format(self.pnt)) + except AttributeError: + print('A point has not been selected') + def display(self): -- GitLab