我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用psyco.full()。
def runMain(main, options, args): if options.profile: if True: import hotshot profile = hotshot.Profile(options.profile) profile.runcall(main, options, args) profile.close() import hotshot.stats stats = hotshot.stats.load(options.profile) else: import profile profile.run('main(options, args)', options.profile) import pstats stats = pstats.Stats(options.profile) stats.strip_dirs() stats.sort_stats('time', 'calls') stats.print_stats(20) elif options.psyco: import psyco psyco.full() status = main(options, args) else: status = main(options, args) return status
def plot(self,ch,point): """ Appends a point to the channel(curve) object ch. Fills the scene and after it is full, shifts the curve one step left, for each new point. If its the first point it creates the plot. """ #Adjust the scene and frames vertically to folow data if point[1] > self.scene.range[1]: self.scene.center[1] = point[1]-9 self.grid.y = point[1]-9 self.ticklabels.y = point[1]-9 elif point[1] < -self.scene.range[1]: self.scene.center[1] = point[1]+9 self.grid.y = point[1]+9 self.ticklabels.y = point[1]+9 #========================================= if self.scene.kb.keys:#key trap s = self.scene.kb.getkey() # obtain keyboard information if s == 'g' or s == 'G': self.toggleGrid() # Scroll scene center right to follow data if len(ch.x) > 0 and ch.x[-1] > 10: # scroll center of the scene with x new_x_center = (ch.x[0]+ch.x[-1])/2. self.scene.center = (new_x_center,0,0) self.updateTicks(ch.x,ch.y) self.grid.x = new_x_center self.ticklabels.x = new_x_center # shift curve and append ch.pos[:-1] = ch.pos[1:] ch.pos[-1] = point else: ch.append(pos=point)
def __init__(self, buff): try: import psyco psyco.full() except ImportError: pass self.__buff = buff self.__idx = 0