本文整理汇总了Python中Canvas.update方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.update方法的具体用法?Python Canvas.update怎么用?Python Canvas.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Canvas
的用法示例。
在下文中一共展示了Canvas.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Canvas
# 需要导入模块: import Canvas [as 别名]
# 或者: from Canvas import update [as 别名]
screen.geometry("%dx%d+0+0"%(wd,ht))
canv = Canvas(screen,height=ht,width=wd,background="black")
canv.pack()
# some scale factor to enlarge the animation
scaley = 150
scalex = 140
# define the time
for t in linspace(0.1,0.5,2000):
# calculate A and B
expA = map(lambda x: A(x,t),x)
expB = map(lambda k: B(k,t),k)
# tranform back the k-room into the real room
expB = ifft(expB)
# calculate the time depended hamiltonien
y = expA*expB*expA
# i took the norm of phi because thr numbers get realy large with t
y = real(y)/max(abs(real(y)))
# draw the waves with lines
for i in range(len(y)-1):
y0=y[i]
y1=y[i+1]
x0=x[i]
x1=x[i+1]
canv.create_line(scalex*x0+650, 400+scaley*y0, scalex*x1+650, 400+scaley*y1,fill='red')
canv.update()
canv.delete(ALL)
screen.mainloop()