アットウィキロゴ

piii

import time
import tkinter
import numpy as np 
 
x=[1,2,3,1,2,3,1,2,3]
y=[1,1,1,2,2,2,3,3,3]
 
root = tkinter.Tk()
root.title("アニメ")
root.geometry("500x500")
can = tkinter.Canvas(root, width = 300, height = 300)
can.place(x=0, y=0)
x=0 
dx=10
mode=0
while mode<50:
    x=x+dx
    if x>250:dx=-10
    if x<50:dx=10    
    time.sleep(0.1)
    can.create_rectangle(0, 0, 300, 300, fill = 'green')
    can.create_rectangle(0, 0, x, x, fill = 'red')
    can.pack()
    can.update()
 
root.mainloop()
最終更新:2018年02月04日 01:02