Python Forum
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Errors
#8
Thanks - serial is OK now.
Trying this program but the 2 print outputs are not displayed.

# -*- coding: utf-8 -*-

import webbrowser
import string
import serial
from pynmea2 import nmea

def to_degrees(lats, longs):
# Convert string forms from ddmm.mmmm to dd°mm'ss.ss“
  msg = pynmea2.parse("$GPGGA,184353.07,1929.045,S,02410.506,E,1,04,2.6,100.00,M,-33.9,M,,0000*6D")
  lat_deg = lats[0:2]
  print lat_deg
 
  lat_mins = lats[2:4]
  print (lat_mins)
  lat_secs = round(float(lats[5:])*60/10000, 2)
  lat_str = lat_deg + u'°'+ lat_mins + string.printable[68] + str(lat_secs) + string.printable[63]

  lon_deg = longs[0:3]
  lon_mins = longs[3:5]
  lon_secs = round(float(longs[6:])*60/10000, 2)
  lon_str = lon_deg + u'°'+ lon_mins + string.printable[68] + str(lon_secs) + string.printable[63]

  return [lat_str, lon_str]
  print(lat_str)
  print msg
Reply


Messages In This Thread
Python Errors - by kendias - May-19-2017, 09:23 PM
RE: Python Errors - by sparkz_alot - May-19-2017, 09:27 PM
RE: Python Errors - by kendias - May-19-2017, 10:02 PM
RE: Python Errors - by nilamo - May-19-2017, 10:08 PM
RE: Python Errors - by snippsat - May-19-2017, 10:23 PM
RE: Python Errors - by kendias - May-20-2017, 10:51 PM
RE: Python Errors - by snippsat - May-20-2017, 11:09 PM
RE: Python Errors - by kendias - May-21-2017, 10:10 PM
RE: Python Errors - by kendias - May-22-2017, 01:13 AM
RE: Python Errors - by kendias - May-22-2017, 02:02 PM
RE: Python Errors - by nilamo - May-22-2017, 02:29 PM
RE: Python Errors - by kendias - May-22-2017, 02:59 PM
RE: Python Errors - by nilamo - May-22-2017, 03:01 PM
RE: Python Errors - by kendias - May-22-2017, 04:59 PM
RE: Python Errors - by nilamo - May-22-2017, 06:04 PM
RE: Python Errors - by Larz60+ - May-22-2017, 06:50 PM
RE: Python Errors - by kendias - May-22-2017, 11:58 PM
RE: Python Errors - by kendias - May-23-2017, 12:31 PM
RE: Python Errors - by kendias - May-23-2017, 01:53 PM
RE: Python Errors - by nilamo - May-23-2017, 07:11 PM
RE: Python Errors - by kendias - May-23-2017, 09:53 PM
RE: Python Errors - by buran - May-24-2017, 08:52 AM
RE: Python Errors - by kendias - May-24-2017, 01:50 PM
RE: Python Errors - by volcano63 - May-24-2017, 07:43 PM
RE: Python Errors - by nilamo - May-24-2017, 06:18 PM
RE: Python Errors - by kendias - May-24-2017, 07:04 PM
RE: Python Errors - by kendias - May-25-2017, 06:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  When does Python detect Errors? stamp1t 1 552 Oct-21-2023, 05:53 PM
Last Post: deanhystad
  Rmarkdown opened by python code - errors Rav013 0 2,186 Apr-27-2021, 03:13 PM
Last Post: Rav013
  Python Request Errors PythonNoob1998 7 4,443 Jan-07-2021, 05:18 PM
Last Post: buran
  Pip Syntax Errors in CMD: Windows 10 and Python 3.8.1 jamesphopper 2 4,615 Feb-08-2020, 07:21 PM
Last Post: jamesphopper
  Python stops without errors shahgourav 4 2,914 Feb-04-2020, 11:44 PM
Last Post: micseydel
  Can the comments produce errors in python? newbieAuggie2019 9 4,675 Nov-26-2019, 12:19 AM
Last Post: micseydel
  Running into errors when installing pip and pip3 on python 2.7 and python 3.6 tej7gandhi 1 2,948 May-05-2019, 10:37 PM
Last Post: snippsat
  Does Python sqlite3 detect connection errors zatlas1 6 4,190 Jan-18-2019, 06:02 AM
Last Post: zatlas1
  Errors in Python dttomoum 1 2,785 May-23-2018, 08:57 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020