カテゴリ:Book:Python

出典: フリー教科書『ウィキブックス(Wikibooks)』

import tkinter

root = tkinter.Tk()

root.title('Hello Window') root.geometry('800x900')

canvasDummy = tkinter.Canvas(root, width = 600, height = 750, bg = "blue") canvasDummy.place(x=0, y=0)

  1. 画像の設定と貼り付け

imgD = tkinter.PhotoImage(file="pygra.png") canvasDummy.create_image(0, 0, image=imgD)

root.mainloop()