From 04c42f289748020561501b1df5f90ac65d223efe Mon Sep 17 00:00:00 2001 From: Rohit Date: Sun, 23 Jul 2017 17:28:01 +0530 Subject: [PATCH] Update serial_scanner.py --- serial_scanner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/serial_scanner.py b/serial_scanner.py index 6e8b7d1f4ad..c97416b7f50 100644 --- a/serial_scanner.py +++ b/serial_scanner.py @@ -40,7 +40,11 @@ def ListAvailablePorts(): else: print '''This method was developed only for linux and windows the current platform isn't recognised''' - return AvailablePorts + if len(AvailablePorts) == 0: + print("NO port in use") + return 0 + else: + return AvailablePorts # EXAMPLE OF HOW IT WORKS