{"id":1210,"date":"2018-09-10T00:17:58","date_gmt":"2018-09-09T15:17:58","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1210"},"modified":"2018-09-10T15:25:47","modified_gmt":"2018-09-10T06:25:47","slug":"tkinter%e3%81%a7%e3%83%9c%e3%82%bf%e3%83%b3%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e9%85%8d%e7%bd%ae%e3%81%97%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1210","title":{"rendered":"tkinter\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u914d\u7f6e\u3057\u3066\u307f\u3088\u3046"},"content":{"rendered":"<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u30a4\u30f3\u30dd\u30fc\u30c8\uff09\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305d\u3057\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u6210\u3057\u3001\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3060\u524d\u56de\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u65b9\u306f<br \/>\n\u3053\u3061\u3089\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1201\" target=\"blank\">tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u3055\u3066\u3001\u4eca\u56de\u306ftkinter\u3092\u5229\u7528\u3057\u3066<br \/>\n\u524d\u56de\u306e\u8a18\u4e8b\u3067\u4f5c\u6210\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u30dc\u30bf\u30f3\u3092\u914d\u7f6e\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011tkinter\u3067\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u3088\u3046<\/h2>\n<p>\u307e\u305a\u524d\u56de\u306e\u8a18\u4e8b\u3068\u540c\u69d8<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import tkinter as tk<\/pre>\n<p>\u3068\u8a18\u8ff0\u3057\u3066\u5b9f\u884c\u3057\u3001tkinter\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u4f8b\u984c1\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\n\r\na = tk.Tk()\r\na.title(&quot;\u3053\u3053\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u540d\u79f0\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) \r\n\r\n\r\nb = tk.Label(text=&quot;\u3053\u3061\u3089\u306e\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() \r\na.mainloop()<\/pre>\n<p>\u4f8b\u984c1\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = tk.Tk()\r\na.title(&quot;\u3053\u3053\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u540d\u79f0\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) <\/pre>\n<p>\u4e0a\u8a18\u307e\u3067\u306f\u524d\u56de\u306e\u8a18\u4e8b\u3068\u540c\u3058\u3067\u3059\u3002<br \/>\n\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u65b9\u306f\u5fa9\u7fd2\u304a\u9858\u3044\u3057\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1201\" target=\"blank\">tkinter\u3092\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b = tk.Label(text=&quot;\u3053\u3061\u3089\u306e\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) <\/pre>\n<p>\u3053\u3053\u3067\u3001tkinter\u306eLabel\u3067\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u300e\u3053\u3061\u3089\u306e\u30dc\u30bf\u30f3\u3067\u30de\u30a6\u30b9\u3092\u30af\u30ea\u30c3\u30af\u300f\u3068\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u5909\u6570b\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b.pack() <\/pre>\n<p>pack\u3067\u30e9\u30d9\u30eb\u3092\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u4e26\u3079\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a.mainloop()<\/pre>\n<p>\u3067\u3059\u304c\u3002<\/p>\n<p>mainloop( )\u30e1\u30bd\u30c3\u30c9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3067\u30a4\u30d9\u30f3\u30c8\u30eb\u30fc\u30d7\u304c\u59cb\u307e\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u306e\u8a18\u8ff0\u3067\u5b9f\u884c\u3059\u308b\u3068<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1215\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/laberuhyouji907.jpg\" alt=\"\u30e9\u30d9\u30eb\" width=\"506\" height=\"276\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/laberuhyouji907.jpg 506w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/laberuhyouji907-300x164.jpg 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/p>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u3010Python\u5165\u9580\u3011tkinter\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u3066\u307f\u3088\u3046<\/h2>\n<p>\u4f8b\u984c1\u3067\u4f5c\u3063\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u306b<br \/>\n\u30dc\u30bf\u30f3\u3092\u4f5c\u3063\u3066\u914d\u7f6e\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c2\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\n\r\na = tk.Tk()\r\na.title(&quot;\u3053\u3053\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u540d\u79f0\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) \r\n\r\n\r\nb = tk.Label(text=&quot;\u3053\u3061\u3089\u306e\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() \r\n\r\ndef botan():\r\n    print('\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002')\r\n    \r\nbota = tk.Button(\r\n    text ='\u3069\u3046\uff1f',\r\n    width =40,\r\n    height = 10,\r\n    command = botan\r\n)\r\nbota.pack()\r\n\r\na.mainloop()<\/pre>\n<p>\u4f8b\u984c2\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = tk.Tk()\r\na.title(&quot;\u3053\u3053\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u540d\u79f0\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) \r\n\r\n\r\nb = tk.Label(text=&quot;\u3053\u3061\u3089\u306e\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() <\/pre>\n<p>\u4e0a\u8a18\u8a18\u8ff0\u307e\u3067\u306f\u4f8b\u984c1\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">def botan():\r\n    print('\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002')<\/pre>\n<p>botan()\u3068\u3044\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3001<br \/>\n\u3082\u3057\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089<br \/>\n\u300e\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002\u300f\u3068\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300c\u95a2\u6570\u306e\u5b9a\u7fa9\u3063\u3066\u4f55\uff1f\u300d<br \/>\n\u3068\u3044\u3046\u5834\u5408\u306b\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=879\" target=\"blank\">tkinter\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u914d\u7f6e\u3057\u3066\u307f\u3088\u3046<\/a><\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">bota = tk.Button(\r\n    text ='\u3069\u3046\uff1f',\r\n    width =40,\r\n    height = 10,\r\n    command = botan\r\n)<\/pre>\n<p>tk.Button\u3067\u3059\u304c<br \/>\ntkinter\u306eButton\u95a2\u6570\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\"> text ='\u3069\u3046\uff1f',\r\n    width =40,\r\n    height = 10,<\/pre>\n<p>\u306e\u90e8\u5206\u3067\u3059\u304c\u3001\u30dc\u30bf\u30f3\u306b\u8868\u793a\u3055\u308c\u308b\u6587\u7ae0\u300e\u3069\u3046\uff1f\u300f\u3001<br \/>\n\u30dc\u30bf\u30f3\u306e\u5e45\uff0840\uff09\u3001\u30dc\u30bf\u30f3\u306e\u9ad8\u3055\uff0810\uff09\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\"> command = botan<\/pre>\n<p>\u3067\u3059\u304c\u3001\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u547c\u3070\u308c\u308b\u95a2\u6570\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306fbotan\u3068\u3044\u3046\u95a2\u6570\u306a\u306e\u3067<br \/>\n\u4f8b\u984c2\u6700\u521d\u306e<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">def botan():\r\n    print('\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002')<\/pre>\n<p>\u304c\u8d77\u52d5\u3055\u308c\u3001\u300e\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002\u300f\u3068\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">bota.pack()<\/pre>\n<p>\u3068\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u30dc\u30bf\u30f3\u304c\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u4e26\u3079\u3066\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u5b9f\u884c\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1218\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/botannn907.jpg\" alt=\"\u30dc\u30bf\u30f3\u4f5c\u6210\" width=\"620\" height=\"350\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/botannn907.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/botannn907-300x169.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u4e0a\u8a18\u753b\u50cf\u306e\u53f3\u5074\u306e\u3088\u3046\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u4e2d\u306b\u30dc\u30bf\u30f3\u304c\u914d\u7f6e\u3055\u308c\u300e\u3069\u3046\uff1f\u300f<br \/>\n\u3068\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u3053\u306e\u30dc\u30bf\u30f3\u3092\u30de\u30a6\u30b9\u3067\u30ab\u30c1\u30c3\u3068\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068<br \/>\n\u8d64\u67a0\u306e\u3088\u3046\u306b\u300e\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002\u300f\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u56de\u6570\u5206\u3060\u3051<br \/>\n\u300e\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u3002\u300f\u3068\u3044\u3046\u6587\u7ae0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3088\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067tkinter\u3092\u4f7f\u3046\u3053\u3068\u3067<br \/>\n\u7c21\u5358\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u30dc\u30bf\u30f3\u3084\u30e9\u30d9\u30eb\u3092\u914d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u3053\u3053\u307e\u3067\u5b66\u7fd2\u3057\u305f\u5185\u5bb9\u3092\u5fdc\u7528\u3057\u3066<br \/>\n\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4e00\u7dd2\u306b\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u7d9a\u304d\u306f\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u30b3\u30b3\u3067\u306f\u306fPython\u3092\u5229\u7528\u3057\u306a\u304c\u3089tkinter\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u5165\u9580\u7de8\u3068\u3057\u3066\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3082\u3057tkinter\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3067\u3042\u3063\u305f\u308a\u7c21\u5358\u306a\u30dc\u30bf\u30f3\u306e\u4f5c\u6210\u3084\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u4f5c\u6210\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u3044\u3068\u3044\u3046\u65b9\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u5148\u306b\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u21d2tk...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=1221\">\u3010Python\u3011tkinter\u306e\u4f7f\u3044\u65b9\u5165\u9580\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u308b<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u306e\u8a18\u4e8b\u3067tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u30a4\u30f3\u30dd\u30fc\u30c8\uff09\u3057\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u6210\u3057\u3001\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u307e\u3060\u524d\u56de\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u65b9\u306f \u3053\u3061\u3089\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u21d2tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b [&hellip;]","protected":false},"author":1,"featured_media":1044,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[123],"tags":[125,126],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1210"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1210"}],"version-history":[{"count":6,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1210\/revisions"}],"predecessor-version":[{"id":1236,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1210\/revisions\/1236"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1044"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}