def buttonclock(): text_position1.configure(text=data_from_xml[0][0] + " in " + nextpass.get(data_from_xml[6][0],data_from_xml[7][0],iss)) text_position2.configure(text=data_from_xml[0][1] + " in " + nextpass.get(data_from_xml[6][1],data_from_xml[7][1],iss)) text_position3.configure(text=data_from_xml[0][2] + " in " + nextpass.get(data_from_xml[6][2],data_from_xml[7][2],iss)) text_position4.configure(text=data_from_xml[0][3] + " in " + nextpass.get(data_from_xml[6][3],data_from_xml[7][3],iss)) text_position5.configure(text=data_from_xml[0][4] + " in " + nextpass.get(data_from_xml[6][4],data_from_xml[7][4],iss)) text_position6.configure(text=data_from_xml[0][5] + " in " + nextpass.get(data_from_xml[6][5],data_from_xml[7][5],iss)) window.after(1000, buttonclock)
import nextpass import ephem import urllib2 #function for opening URLs import urllib boston = ephem.city('Boston') data = urllib2.urlopen("http://www.celestrak.com/NORAD/elements/stations.txt") stations_text_file = [] for line in data: stations_text_file.append(line) iss = ephem.readtle(stations_text_file[0], stations_text_file[1], stations_text_file[2]) print(nextpass.get(boston.lat,boston.lon,iss))