from subprocess import Popen, PIPE
import datetime
# otevreni slozky GPS a prevod pro praci s Pythonem
def get_data():
    p = Popen(["sudo", "/home/pi/GPS/SIM7600X/GPS/GPS"], stdout=PIPE)
    stdout = p.communicate()[0]
    output = stdout.decode("UTF-8")
# Vypsani pozadovanych hodnot    
    for line in output.splitlines():
        
            if line.find("Latitude") > -1:
                sirka=float(line.split(" ")[2])


            if line.find("Longitude") > -1:
                delka= float(line.split(" ")[2])

        
            if line.find("Day") > -1:
                den= str(line.split(" ")[4])


            if line.find("UTC") > -1:
                cas=str(line.split(" ")[3])

            
    return sirka, delka, den, cas
#vypsani hodnoty pro kontrolu pripojeni
print (get_data()[3])