From c22b06f158ba94f21f1cdd5c38ebf7104fe74872 Mon Sep 17 00:00:00 2001 From: xw_y_am Date: Tue, 12 Mar 2019 00:48:05 +0800 Subject: [PATCH] analyse_serial_gps_info add python --- analyse_serial_gps_info/v.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 analyse_serial_gps_info/v.py diff --git a/analyse_serial_gps_info/v.py b/analyse_serial_gps_info/v.py new file mode 100644 index 0000000..b0a38ee --- /dev/null +++ b/analyse_serial_gps_info/v.py @@ -0,0 +1,17 @@ + +def match(s): + return s.find('qxwz_response') > -1 + +def sub(s): + pos = s.find('$') + if pos < 0: + return '' + return s[pos + 1:] + +def split(s): + return list(s.strip().split(',')) + +if __name__ == '__main__': + for line in open('1fps.txt'): + if match(line): + print(split(sub(line)))