diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-10-17 21:38:38 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-10-17 21:38:38 -0400 |
commit | 9433098a3ff236717104f904e0098b91bb7f1329 (patch) | |
tree | d276db78f6ad625533878e9e3bf2db00f02c7425 | |
parent | 94dc9c49c283cd576c25692d17567035557a2505 (diff) |
Report meaningful error if pyserial not present in tools/readserial.py
-rwxr-xr-x | tools/readserial.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/readserial.py b/tools/readserial.py index 505c014..9c955c6 100755 --- a/tools/readserial.py +++ b/tools/readserial.py @@ -111,7 +111,15 @@ def main(): if options.serial: # Read from serial port - import serial + try: + import serial + except ImportError: + print """ +Unable to find pyserial package ( http://pyserial.sourceforge.net/ ). +On Linux machines try: yum install pyserial +Or: apt-get install python-serial +""" + sys.exit(1) ser = serial.Serial(serialport, baud, timeout=0) else: # Read from a file |