0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

tkinterのWindow表示

Posted at

tkinterのimport

 import tkinter as tk

as tk とは tkinterを略してtkと呼ぶ  
ということを定義するものです。


Window表示

Windowの名前 = tk.Tk()

とすることでWindowを作れます。

例  
 import tkinter as tk
 root = tk.Tk()

Windowにタイトルを設定

Window名.title(タイトル名)

のようにするとWindowのタイトルを設定できます。

 import tkinter as tk
 root = tk.Tk()
 root.title("ここにタイトルを入力")

Windowのサイズ指定

Window名.geometry("横x縦")

とするとWindowのサイズを指定できます。

 import tkinter as tk
 root = tk.Tk()
 root.title("ここにタイトルを入力")
 root.geometry("300x200")

「" "」を忘れないように

「横x縦」のxは英語の「エックス」

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?