本文整理汇总了Python中track.Track.load_local方法的典型用法代码示例。如果您正苦于以下问题:Python Track.load_local方法的具体用法?Python Track.load_local怎么用?Python Track.load_local使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.load_local方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: App
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import load_local [as 别名]
class App(Tk):
def __init__(self, ftimer):
Tk.__init__(self)
self.sats = Track()
self.sats.load_local("data.txt") # to be changed
self.sats.add_satellite(7) # achtung, hardcode
menu = UserMenu(parent = self)
self.config(menu = menu)
self.title('SatKit Ground Tracking')
self.timer = ftimer
self.timer.callback_function = self.redraw
self.time_speed = 1 # normal speed
self.var = IntVar()
self.scale = Scale(self, variable = self.var, from_ = 1, to = 3600,
orient = HORIZONTAL, showvalue=0, sliderlength=15,
length=400, command=self.set_time_speed)
self.date = Label(self)
def redraw(self):
self.timer.set_speed(self.time_speed) # bad, should be improven,~event
self.sats.update_satellites(self.time_speed * Time.TIMER_INTERVAL)
#print self.time_speed
# recompute "current" time, later,,,
self.date.config(text = str(self.timer.current_time)[0:21])
self.date.grid(row = 0, column = 1)
self.scale.grid(row = 0, column = 0)
self.sats.anim.grid(row = 1, columnspan = 2)
self.sats.draw()
def set_time_speed(self, secs):
self.time_speed = int(secs)