freemarker的assign标签有什么用
更新时间:2022-04-28 15:04
最满意答案
from Tkinter import * def slower(): global time time+=100 def faster(): global time time-=100 root = Tk() c = Canvas(root,width=300,height=200,bg='white') c.pack() time=500 button1=Button(text='slower',command=slower) button1.pack() button2=Button(text='faster',command=faster) button2.pack() orbit = c.create_oval(50,50,250,150) sun = c.create_oval(110,85,140,115,fill='red') earth = c.create_oval(245,95,255,105,fill='blue') moon = c.create_oval(265,98,270,103) eX = 250 # earth's X eY = 100 # earth's Y m2eX = 20 # moon's X relative to earth m2eY = 0 # moon's Y relative to earth t = 0 while True: t = t + 0.01*pi new_eX = 150 + 100 * cos(t) new_eY = 100 - 50 * sin(t) new_m2eX = 20 * cos(12*t) new_m2eY = -15 * sin(12*t) edx = new_eX - eX edy = new_eY - eY mdx = new_m2eX - m2eX mdy = new_m2eY - m2eY c.move(earth,edx,edy) c.move(moon,mdx+edx,mdy+edy) c.update() eX = new_eX eY = new_eY m2eX = new_m2eX m2eY = new_m2eY c.after(time) c.update()
其他回答
我是来看评论的
相关问答
更多-
电脑应用专业出来找什么工作啊?[2023-05-22]
编程 -
信息与电脑科学是学什么的?[2022-11-19]
编程 -
gcc 是编译器,它当然没有图形库。 可以装qt、gtk等 前者基于C++,后者基于C 前者编程时简单,同样的功能可能我们自已要写的代码要少很多,后者基于C,当然就移植性强了
-
python图形编程问题[2022-02-14]
可以使用QT来实现,做起来还是挺容易的。 -
python 图形编程 演示天体运动 如何创建按钮点击后速度加快或变慢[2023-07-10]
from Tkinter import * def slower(): global time time+=100 def faster(): global time time-=100 root = Tk() c = Canvas(root,width=300,height=200,bg='white') c.pack() time=500 button1=Button(text='slower',command=slower) button1.pack() button2=Button(text='fa ... -
python gui图形界面[2023-02-24]
你好,你这种情况有两种解决办法,说明文档跟随程序,程序直接用相对路径打开说明文档。第二种就是说明文档放在网上,点击帮助按钮直接跳转到该网页 -
python-pptx - 如何以编程方式访问演示文稿部分标题?(python-pptx - How to access presentation section titles programmatically?)[2023-08-09]
PowerPoint 2010及更高版本将section的概念作为在演示文稿中组织幻灯片的方法: https://support.office.com/en-us/article/Organize-your-slides-into-sections-de4bf162-e9cc-4f58-b64a-7ab09443b9f8 。 这些部分对象与幻灯片不同,并以幻灯片分拣和大纲模式显示。 我将它们描述为主要的创作功能,因为它们不直接出现在演示模式中。 这与seque (发音为seg-way )幻灯片的概念形成对比 ... -
如果您想学习OpenGL,请直接访问源代码: http://www.opengl.org/documentation/red_book/ 决定你的引擎需要什么,快速搜索红皮书会告诉你需要做什么以及如何做。 这是每个OpenGL程序员应该拥有的惊人参考。 如果你不想购买它,它们在网上有较旧的(但仍然有用!)版本(在我发布的链接上)。 我实际上有两个副本,因为(当我在做OpenGL时)我在工作和家庭中使用了它。 If you want to learn OpenGL, go straight to the so ...