I am invoking a function header_gps,header_glonass etc. in if else statement but the variables defined in there seem not be stored as they should be. May be i am missing something , please help. I am writing my code here itself.
"""Script for header section of rinex navigation file""" from header_gps import header_gps from header_glonass import header_glonass from header_galileo import header_galileo from header_beidou import header_beidou def header(filepath): with open(filepath) as fp: data = fp.read() data=data.split("END OF HEADER") data=data[0] i=0 while i>=0: if data[i]==' ': i=i+1 continue else: break if data[i]=='2': print("Rinex_2") #Rinex_2 elif data[i]=='3': print("Rinex_3") if 'GPS' in data[0:80]: print(" GPS") header_gps(data) elif 'GALILEO' in data[0:80]: print(" GALILEO") header_galileo(data) elif 'GLONASS' in data[0:80]: header_glonass(data) print("glonass") elif 'BEIDOU' in data[0:80]: print("BEIDOU") header_beidou(data) #Rinex_3 else: print("Version is not defined") filepath='/home/ibaad/Downloads/rinexfile/ABMF00GLP_R_20180010000_01H_EN.rnx' header(filepath)