{"id":1221,"date":"2018-09-12T00:43:02","date_gmt":"2018-09-11T15:43:02","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1221"},"modified":"2018-09-10T08:56:25","modified_gmt":"2018-09-09T23:56:25","slug":"%e3%80%90python%e3%80%91tkinter%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e5%85%a5%e9%96%80%e3%81%8a%e3%81%bf%e3%81%8f%e3%81%98%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1221","title":{"rendered":"\u3010Python\u3011tkinter\u306e\u4f7f\u3044\u65b9\u5165\u9580\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u308b"},"content":{"rendered":"<p>\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<br \/>\n\u5165\u9580\u7de8\u3068\u3057\u3066\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3082\u3057tkinter\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3067\u3042\u3063\u305f\u308a<br \/>\n\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<br \/>\n\u3068\u3044\u3046\u65b9\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u5148\u306b\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1201\" target=\"blank\">tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1210\" target=\"blank\">tkinter\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u914d\u7f6e\u3057\u3066\u307f\u3088\u3046<\/a><\/p>\n<h2>\u3010Python\u3011tkinter\u306e\u4f7f\u3044\u65b9\u5165\u9580\uff1a\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3055\u305b\u3088\u3046<\/h2>\n<p>\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u3063\u3066\u8868\u793a\u3055\u305b\u305f\u308a<br \/>\n\u30e9\u30d9\u30eb\u3084\u30dc\u30bf\u30f3\u3092\u4f5c\u3063\u3066\u8868\u793a\u3055\u305b\u305f\u308a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3093\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1201\" target=\"blank\">tkinter\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=1210\" target=\"blank\">tkinter\u3067\u30dc\u30bf\u30f3\u3092\u4f5c\u6210\u3057\u914d\u7f6e\u3057\u3066\u307f\u3088\u3046<\/a><\/p>\n<p>\u307e\u305a<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import tkinter as tk<\/pre>\n<p>\u3092\u5b9f\u884c\u3057\u3066\u3001tkinter\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u305d\u306e\u3046\u3048\u3067<\/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\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>\u3068\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u3084\u30dc\u30bf\u30f3\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068<br \/>\n\u300c\u3053\u308c\u304c\u30dc\u30bf\u30f3\u3067\u3059\u300d<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u753b\u50cf\u304c\u4f8b\u984c1\u5b9f\u884c\u5f8c\u306e\u3082\u306e\u3067\u3059\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>\u6b21\u306b\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import tkinter.messagebox as mb<\/pre>\n<p>\u3068\u8a18\u8ff0\u3057\u3066\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u308c\u3067tkinter\u306emessagebox\u304c\u30a4\u30f3\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>messagebox\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067<br \/>\n\u3044\u308d\u3093\u306a\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u4f8b\u984c2\u3092\u4e00\u7dd2\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\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\u304a\u307f\u304f\u3058\u304c\u3067\u304d\u307e\u3059\u3088\u3002\u4e0b\u8a18\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3067\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) \r\n\r\n\r\nb = tk.Label(text=&quot;\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() \r\n\r\ndef botan():\r\n     mb.showinfo(&quot;\u304a\u307f\u304f\u3058\u7d50\u679c&quot;, &quot;\u4e2d\u5409\u3067\u3059\u3002&quot;)\r\n    \r\nbota = tk.Button(\r\n    text ='\u304a\u307f\u304f\u3058\u3092\u5f15\u304f',\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>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1224\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907.jpg\" alt=\"\u30a6\u30a3\u30f3\u30c9\u30a6\" width=\"506\" height=\"273\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907.jpg 506w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907-300x162.jpg 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/p>\n<p>\u4e0a\u8a18\u753b\u50cf\u306e\u3088\u3046\u306a\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a = tk.Tk()<\/pre>\n<p>\u3067\u3059\u304c\u3001\u5909\u6570a\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4ee3\u5165\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">a.title(&quot;\u3053\u3053\u3067\u304a\u307f\u304f\u3058\u304c\u3067\u304d\u307e\u3059\u3088\u3002\u4e0b\u8a18\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3067\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) <\/pre>\n<p>\u3067\u3059\u304c\u3001\u4e0a\u8a18\u753b\u50cf\u3092\u898b\u3066\u3044\u305f\u3060\u304f\u3068<br \/>\n\u300e\u3053\u3053\u3067\u304a\u307f\u304f\u3058\u304c\u3067\u304d\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3067\u3059\u3002\u300f\u3068\u3044\u3046\u3068\u3053\u308d\u306b<br \/>\n\u6587\u5b57\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089geometry(&#8220;500&#215;250&#8221;)\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5927\u304d\u3055\u3092<br \/>\n\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">b = tk.Label(text=&quot;\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() <\/pre>\n<p>\u3067\u3059\u304c\u3001\u300e\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af\u300f\u3068\u8868\u793a\u3055\u308c\u308b\u6587\u5b57\u5217\u3092\u8a18\u8ff0\u3057\u3066\u3044\u3066<br \/>\npack\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u3068\u4e26\u3093\u3067\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1225\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/windou907.jpg\" alt=\"\u30a6\u30a3\u30f3\u30c9\u30a6\" width=\"620\" height=\"337\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/windou907.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/windou907-300x163.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u300e\u4e2d\u5409\u3067\u3059\u3002\u300f\u3068\u3044\u3046\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">     mb.showinfo(&quot;\u304a\u307f\u304f\u3058\u7d50\u679c&quot;, &quot;\u4e2d\u5409\u3067\u3059\u3002&quot;)<\/pre>\n<p>\u306e\u8a18\u8ff0\u3067\u5b9f\u73fe\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>OK\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u9589\u3058\u307e\u3059\u306e\u3067\u5b89\u5fc3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u3010Python\u3011tkinter\u306e\u4f7f\u3044\u65b9\u5165\u9580\uff1a\u4e71\u6570\u3092\u4f7f\u3063\u3066\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u5b8c\u6210\u3055\u305b\u308b<\/h2>\n<p>\u3067\u306f\u4e71\u6570\u3092\u4f7f\u3063\u3066\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u5b8c\u6210\u3055\u305b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import random<\/pre>\n<p>\u3068\u8a18\u8ff0\u3057\u3066\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u308c\u3067\u4e71\u6570\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u4e0a\u3067\u4f8b\u984c3<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c3\r\n\r\nkekka = [ \r\n    [&quot;\u5927\u5409&quot;, &quot;\u4eca\u65e5\u30011\u4e07\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5409&quot;, &quot;\u4e0a\u53f8\u304b\u3089\u8912\u3081\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u4e2d\u5409&quot;, &quot;\u5bb6\u65cf\u306b\u8912\u3081\u3066\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5c0f\u5409&quot;, &quot;100\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u672b\u5409&quot;, &quot;\u5929\u6d25\u98ef\u3092\u98df\u3079\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u51f6&quot;, &quot;\u3081\u3093\u3069\u304f\u3055\u3044\u30aa\u30d0\u30b5\u30f3\u306b\u7d61\u307e\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5927\u51f6&quot;, &quot;\u30b9\u30ad\u30f3\u30d8\u30c3\u30c9\u306e\u7537\u306b\u6bb4\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;]\r\n]\r\n\r\n\r\na = tk.Tk()\r\na.title(&quot;\u3053\u3053\u3067\u304a\u307f\u304f\u3058\u304c\u3067\u304d\u307e\u3059\u3088\u3002\u4e0b\u8a18\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3067\u3059\u3002&quot;) \r\na.geometry(&quot;500x250&quot;) \r\n\r\n\r\nb = tk.Label(text=&quot;\u30de\u30a6\u30b9\u3067\u30af\u30ea\u30c3\u30af&quot;) \r\nb.pack() \r\n\r\ndef botan():\r\n    c = random.randrange(len(kekka)) \r\n    r = kekka \r\n    mb.showinfo(r[0], r[1]) \r\n    \r\nbota = tk.Button(\r\n    text ='\u304a\u307f\u304f\u3058\u3092\u5f15\u304f',\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\u984c3\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907.jpg\" alt=\"\u30a6\u30a3\u30f3\u30c9\u30a6\" width=\"506\" height=\"273\" class=\"alignnone size-full wp-image-1224\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907.jpg 506w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/konnnabojusu907-300x162.jpg 300w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/p>\n<p>\u4f8b\u984c2\u3068\u540c\u3058\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kitisann909.jpg\" alt=\"\u5409\" width=\"620\" height=\"237\" class=\"alignnone size-full wp-image-1228\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kitisann909.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kitisann909-300x115.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u5409\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3046\u4e00\u5ea6\u3001\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4eca\u5ea6\u306f\u30fb\u30fb\u30fb<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kyousan909.jpg\" alt=\"\u51f6\u304c\u3067\u305f\" width=\"620\" height=\"237\" class=\"alignnone size-full wp-image-1229\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kyousan909.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/kyousan909-300x115.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>\u51f6\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001\u4e71\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067<br \/>\n\u30e9\u30f3\u30c0\u30e0\u306a\u304a\u307f\u304f\u3058\u306e\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c3\u3067\u306f\u4f8b\u984c2\u306e\u8a18\u8ff0\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">kekka = [ \r\n    [&quot;\u5927\u5409&quot;, &quot;\u4eca\u65e5\u30011\u4e07\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5409&quot;, &quot;\u4e0a\u53f8\u304b\u3089\u8912\u3081\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u4e2d\u5409&quot;, &quot;\u5bb6\u65cf\u306b\u8912\u3081\u3066\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5c0f\u5409&quot;, &quot;100\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u672b\u5409&quot;, &quot;\u5929\u6d25\u98ef\u3092\u98df\u3079\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u51f6&quot;, &quot;\u3081\u3093\u3069\u304f\u3055\u3044\u30aa\u30d0\u30b5\u30f3\u306b\u7d61\u307e\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5927\u51f6&quot;, &quot;\u30b9\u30ad\u30f3\u30d8\u30c3\u30c9\u306e\u7537\u306b\u6bb4\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;]\r\n]<\/pre>\n<p>\u3068<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = random.randrange(len(kekka)) \r\n    r = kekka \r\n    mb.showinfo(r[0], r[1]) <\/pre>\n<p>\u306e\u8a18\u8ff0\u3092\u52a0\u3048\u305f\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">kekka = [ \r\n    [&quot;\u5927\u5409&quot;, &quot;\u4eca\u65e5\u30011\u4e07\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5409&quot;, &quot;\u4e0a\u53f8\u304b\u3089\u8912\u3081\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u4e2d\u5409&quot;, &quot;\u5bb6\u65cf\u306b\u8912\u3081\u3066\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5c0f\u5409&quot;, &quot;100\u5186\u3082\u3089\u3048\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u672b\u5409&quot;, &quot;\u5929\u6d25\u98ef\u3092\u98df\u3079\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u51f6&quot;, &quot;\u3081\u3093\u3069\u304f\u3055\u3044\u30aa\u30d0\u30b5\u30f3\u306b\u7d61\u307e\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;],\r\n    [&quot;\u5927\u51f6&quot;, &quot;\u30b9\u30ad\u30f3\u30d8\u30c3\u30c9\u306e\u7537\u306b\u6bb4\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002&quot;]\r\n]<\/pre>\n<p>\u306b\u3088\u3063\u3066\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u5f8c\u306b\u5f97\u3089\u308c\u308b\u7d50\u679c\u3092\u8907\u6570\u7528\u610f\u3057<br \/>\nkekka\u3068\u3044\u3046\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = random.randrange(len(kekka)) <\/pre>\n<p>\u5148\u307b\u3069\u3001\u304a\u307f\u304f\u3058\u306e\u7d50\u679c\u306e\u60c5\u5831\u304c\u5165\u3063\u3066\u3044\u308bkekka\u306b\u5bfe\u3057\u3066<br \/>\nlen()\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u9577\u3055\u3092\u8abf\u3079\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>len()\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=837\" target=\"blank\">\u3010Python\u3011\u6587\u5b57\u5217\u3092\u524a\u9664\u30fb\u9577\u3055\u3092\u8abf\u3079\u308b\u30fb\u6570\u5024\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<p>\u3067\u3001len\u3067\u9577\u3055\u3092\u53d6\u5f97\u3057\u3001<br \/>\nrandom.randrange\u306b\u3088\u3063\u3066\u3001len\u3067\u8abf\u3079\u305f\u9577\u3055\u306e\u7bc4\u56f2\u306b\u304a\u3051\u308b\u4e71\u6570\u3092<br \/>\n\u6574\u6570\u3067\u53d6\u5f97\u3057\u3001\u5909\u6570c\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u3053\u3053\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">  r = kekka <\/pre>\n<p>\u5f97\u3089\u308c\u305f\u7d50\u679c\u3092\u5909\u6570r\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    mb.showinfo(r[0], r[1])<\/pre>\n<p>\u5909\u6570r\u306b\u5165\u3063\u3066\u3044\u308b\u7d50\u679c\u5185\u5bb9\u304c<br \/>\nr[0], r[1]\u306b\u3088\u3063\u3066\u3001\u30bf\u30a4\u30c8\u30eb\u3068\u672c\u6587\u306b\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u306f\u4f8b\u984c2\u3068\u540c\u3058\u306a\u306e\u3067\u89e3\u8aac\u306f\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u4e71\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067<br \/>\n\u304a\u307f\u304f\u3058\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3084\u308a\u65b9\u306b\u3088\u3063\u3066\u306f\u82f1\u5358\u8a9e\u3068\u65e5\u672c\u8a9e\u8a33\u3092\u7d44\u307f\u5408\u308f\u305b\u3066<br \/>\n\u5358\u8a9e\u5e33\u30a2\u30d7\u30ea\u3092\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\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 [&hellip;]","protected":false},"author":1,"featured_media":1102,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[123],"tags":[3,125,13,127],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1221"}],"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=1221"}],"version-history":[{"count":6,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1221\/revisions"}],"predecessor-version":[{"id":1231,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1221\/revisions\/1231"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1102"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}