{"id":6612,"date":"2022-10-30T22:16:32","date_gmt":"2022-10-30T13:16:32","guid":{"rendered":"https:\/\/auto-worker.com\/blog\/?p=6612"},"modified":"2022-10-30T22:16:33","modified_gmt":"2022-10-30T13:16:33","slug":"post-6612","status":"publish","type":"post","link":"https:\/\/auto-worker.com\/blog\/?p=6612","title":{"rendered":"Python\u3067\u65e2\u5b58\u306eExcel\u30d6\u30c3\u30af\u3092\u958b\u304f\u30fb\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5(WIndows\u76f8\u5bfe\u30d1\u30b9\u30fb\u7d76\u5bfe\u30d1\u30b9)"},"content":{"rendered":"\n<p>AI\u3084\u6a5f\u68b0\u5b66\u7fd2\u3067\u306e\u591a\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308bPython\u306b\u306f\u591a\u6570\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u3001Excel\u306a\u3069\u306e\u8868\u8a08\u7b97\u30d6\u30c3\u30af\u306e\u64cd\u4f5c\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>Python\u306e\u30a8\u30af\u30bb\u30eb\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u6700\u3082\u6709\u540d\u306aopenpyxl\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306eExcel\u30d5\u30a1\u30a4\u30eb\u3092Python\u3067\u958b\u304f\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Windows\u3067\u306ePython\u5229\u7528\u3067\u76f8\u5bfe\u30d1\u30b9\u3068\u7d76\u5bfe\u30d1\u30b9\u306e2\u7a2e\u985e\u306e\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python\u3067\u30a8\u30af\u30bb\u30eb\u3092\u6271\u3046openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea<\/h2>\n\n\n\n<p>Python\u306f\u5b66\u7fd2\u3057\u3084\u3059\u3055\u3084AI\u306a\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5145\u5b9f\u3057\u3066\u3044\u3066\u3001\u8fd1\u5e74\u4eba\u6c17\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6a5f\u68b0\u5b66\u7fd2\u3084\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u306a\u3069\u306eAI\u5206\u91ce\u3067\u306ePython\u304c\u6709\u540d\u3067\u3059\u304c\u3001\u8868\u8a08\u7b97\u30bd\u30d5\u30c8\u3067\u3042\u308bExcel\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3082\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u306e\u69d8\u3005\u306a\u96c6\u8a08\u3084\u30c7\u30fc\u30bf\u51e6\u7406\u3092Python\u306b\u3088\u3063\u3066\u81ea\u52d5\u5316\u304c\u5b9f\u73fe\u3067\u304d\u3001\u696d\u52d9\u6539\u5584\u306b\u6d3b\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>Python\u306b\u306f\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u3001\u305d\u306e\u4e2d\u3067\u3082openpyxl\u304c\u6700\u3082\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>openpyxl\u3092\u4f7f\u3048\u3070\u3001\u30a8\u30af\u30bb\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u308a\u3001\u3059\u3067\u306b\u4f5c\u6210\u6e08\u307f\u306eExcel\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h2>\n\n\n\n<p>Python\u3067\u30a8\u30af\u30bb\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u306f\u3001openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203b\u7d39\u4ecb\u3059\u308b\u65b9\u6cd5\u306fWindowsOS\u74b0\u5883\u3067\u3001\u4e8b\u524d\u306bPython\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u9808\u3067\u3059\u3002<\/p>\n\n\n\n<p>openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001Python\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308bpip\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"419\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001.jpg\" alt=\"Python\u3067\u30a8\u30af\u30bb\u30eb\u64cd\u4f5c\u304c\u3067\u304d\u308bopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u306fpip\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u300cpip install openpyxl\u300d\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\" class=\"wp-image-6598\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-300x157.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-768x402.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-530x278.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-565x296.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-710x372.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_001-725x380.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>pip\u30b3\u30de\u30f3\u30c9\u3067openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3001Python\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067openpyxl\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python\u3067\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>\u5b9f\u969b\u306bPython\u3067\u4f5c\u6210\u6e08\u307f\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"424\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3057\u3066\u4f5c\u6210\u3055\u308c\u305f\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\" class=\"wp-image-6603\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-300x159.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-768x407.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-530x281.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-565x299.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-710x376.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221024_auto_006-725x384.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u4e0a\u306e\u300csample.xlsx\u300d\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092python\u3067\u8aad\u307f\u8fbc\u3093\u3067\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-python\"><code class=\"language-python\">#openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nimport openpyxl\n\n#\u3059\u3067\u306b\u5b58\u5728\u3059\u308bExcel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080\nwb = openpyxl.load_workbook(\"sample.xlsx\")\n#\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u5185\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\nws = wb.active\n#\u30b7\u30fc\u30c8\u5185\u306eA1\u30bb\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u5024\u3092\u8868\u793a\nprint(ws[\"A1\"].value)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-1024x544.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb(\u30ef\u30fc\u30af\u30d6\u30c3\u30af)\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" class=\"wp-image-6613\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-1024x544.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-300x160.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-768x408.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-530x282.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-565x300.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-710x377.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001-725x385.jpg 725w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_001.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u307e\u305a\u3001\u4e8b\u524d\u306bpip\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7d9a\u3044\u3066openpyxl.load_workbook()\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u30a8\u30af\u30bb\u30eb\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\u3057\u3001A1\u30bb\u30eb\u306b\u3042\u308b\u5024\u3092print\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"440\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb(\u30ef\u30fc\u30af\u30d6\u30c3\u30af)\u3092\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092python\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3001\u30bb\u30eb\u306e\u5024\u3092pirnt\u51fa\u529b\" class=\"wp-image-6614\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-300x165.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-768x422.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-530x292.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-565x311.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-710x391.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_002-725x399.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u304d\u3061\u3093\u3068sample.xlsx\u306eA1\u30bb\u30eb\u306b\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u5217\u304c\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d76\u5bfe\u30d1\u30b9\u6307\u5b9a\u3067Excel\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u307f(WindowsOS)<\/h2>\n\n\n\n<p>\u5148\u7a0b\u306eExcel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u8aad\u307f\u8fbc\u307f\u306fpython\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u540c\u3058\u30d5\u30a9\u30eb\u30c0(\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3060\u3063\u305f\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u3046\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u6307\u5b9a\u65b9\u6cd5\u306f\u76f8\u5bfe\u30d1\u30b9\u306b\u3088\u308b\u6307\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u307b\u304b\u306b\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u3068\u3057\u3066\u300c\u7d76\u5bfe\u30d1\u30b9\u300d\u306b\u3088\u308b\u5f15\u6570\u6307\u5b9a\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7d76\u5bfe\u30d1\u30b9\u306b\u3088\u308bopenpyxl.load_workbook\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u6307\u5b9a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-python\"><code class=\"language-python\">#openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nimport openpyxl\n\n#\u3059\u3067\u306b\u5b58\u5728\u3059\u308bExcel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080(\u7d76\u5bfe\u30d1\u30b9)\nwb = openpyxl.load_workbook(\"C:\/Users\/yamamoto\/Desktop\/programming\/python_excel\/sample.xlsx\")\n#\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u5185\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\nws = wb.active\n#\u30b7\u30fc\u30c8\u5185\u306eA1\u30bb\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u5024\u3092\u8868\u793a\nprint(ws[\"A1\"].value)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"549\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-1024x549.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb(\u30ef\u30fc\u30af\u30d6\u30c3\u30af)\u3092\u7d76\u5bfe\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9(Windows)\" class=\"wp-image-6615\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-1024x549.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-300x161.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-768x412.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-530x284.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-565x303.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-710x380.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003-725x388.jpg 725w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_003.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u5148\u7a0b\u306epython\u30b3\u30fc\u30c9\u3068\u540c\u3058\u3088\u3046\u306b\u30a8\u30af\u30bb\u30eb\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3093\u3067priint\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001Windows\u306e\u30d1\u30b9\u6307\u5b9a\u306f\u300cC:\\Users\\name\u300d\u3067\u3059\u304c\u3001python\u3067\u8a18\u8ff0\u3059\u308b\u969b\u306f\u300c\\\u2192\/\u300d\u306b\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u76f8\u5bfe\u30d1\u30b9\u6307\u5b9a\u3067\u5225\u30d5\u30a9\u30eb\u30c0\u306eExcel\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u307f(WindowsOS)<\/h2>\n\n\n\n<p>\u7d9a\u3044\u3066\u76f8\u5bfe\u30d1\u30b9\u6307\u5b9a\u3067\u3001python\u30d5\u30a1\u30a4\u30eb\u3068\u5225\u306e\u30d5\u30a9\u30eb\u30c0(\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306b\u3042\u308bExcel\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3093\u3067\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>excel\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3066\u305d\u306e\u914d\u4e0b\u306bsample2.xlsx\u306e\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"437\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005.jpg\" alt=\"python\u30d5\u30a1\u30a4\u30eb\u3068\u306f\u5225\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3057\u305f\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\" class=\"wp-image-6617\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-300x164.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-768x420.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-530x290.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-565x309.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-710x388.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_005-725x396.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u76f8\u5bfe\u30d1\u30b9\u3067\u306f\u3001\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f4d\u7f6e\u3092\u300c.\u300d\u3067\u8868\u73fe\u3057\u3001\u305d\u3053\u304b\u3089\u306e\u4f4d\u7f6e\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-python\"><code class=\"language-python\">#openpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nimport openpyxl\n\n#\u3059\u3067\u306b\u5b58\u5728\u3059\u308bExcel\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080(\u76f8\u5bfe\u30d1\u30b9)\nwb = openpyxl.load_workbook(\".\/excel\/sample2.xlsx\")\n#\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u5185\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\nws = wb.active\n#\u30b7\u30fc\u30c8\u5185\u306eA1\u30bb\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u5024\u3092\u8868\u793a\nprint(ws[\"A1\"].value)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-1024x542.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u5225\u30d5\u30a9\u30eb\u30c0(\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306b\u3042\u308b\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb(\u30ef\u30fc\u30af\u30d6\u30c3\u30af)\u3092\u76f8\u5bfe\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9(Windows)\" class=\"wp-image-6616\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-1024x542.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-300x159.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-768x406.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-530x280.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-565x299.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-710x376.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004-725x384.jpg 725w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_004.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>python\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001sample2.xlsx\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3001print\u51fa\u529b\u3055\u308c\u308b\u6587\u5b57\u5217\u304c\u5909\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"191\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_006.jpg\" alt=\"Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u5225\u30d5\u30a9\u30eb\u30c0(\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\u306b\u3042\u308b\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb(\u30ef\u30fc\u30af\u30d6\u30c3\u30af)\u3092\u76f8\u5bfe\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u307f\u3001\u30bb\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3001\u30bb\u30eb\u306e\u5024\u304cprint\u51fa\u529b\u6210\u529f\" class=\"wp-image-6618\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_006.jpg 600w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_006-300x96.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_006-530x169.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2022\/10\/20221030_auto_006-565x180.jpg 565w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>\u76f8\u5bfe\u30d1\u30b9\u306b\u3088\u308b\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u6307\u5b9a\u306f\u3088\u304f\u4f7f\u308f\u308c\u308b\u306e\u3067\u3001load_workbook\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u6307\u5b9a\u306f\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python\u3067Excel\u30d6\u30c3\u30af\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u306b\u306f<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3059\u3067\u306b\u4f5c\u6210\u3055\u308c\u3066\u3044\u308bExcel\u30d6\u30c3\u30af\u3092Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u8aad\u307f\u8fbc\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u65e2\u5b58\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u958b\u304f\u4ee5\u5916\u306b\u3001openpyxl\u3067\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203bPython\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u30a8\u30af\u30bb\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580 wp-block-embed-autoworker\u301cgoogle-apps-script-gas-\u3068sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"f0FZ53Otpw\"><a href=\"https:\/\/auto-worker.com\/blog\/?p=6597\">Python\u3067Excel\u30d6\u30c3\u30af\u3092\u65b0\u898f\u4f5c\u6210\u3057\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5(openpyxl)<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Python\u3067Excel\u30d6\u30c3\u30af\u3092\u65b0\u898f\u4f5c\u6210\u3057\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5(openpyxl)&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=6597&#038;embed=true#?secret=a2DE7QhT2i#?secret=f0FZ53Otpw\" data-secret=\"f0FZ53Otpw\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\u30fb\u7d42\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u3001Python\u306eopenpyxl\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>openpyxl.load_workbook\u30e1\u30bd\u30c3\u30c9\u3067Excel\u30d6\u30c3\u30af\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30a8\u30af\u30bb\u30eb\u30d6\u30c3\u30af\u306e\u5f15\u6570\u6307\u5b9a\u65b9\u6cd5\u306f\u76f8\u5bfe\u30d1\u30b9\u3068\u7d76\u5bfe\u30d1\u30b9\u306e2\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001Windows\u306e\u5834\u5408\u3001\u30d1\u30b9\u6307\u5b9a\u6642\u306b\u300c\\\u300d\u3092\u4f7f\u3046\u3068\u30a8\u30e9\u30fc\u3059\u308b\u306e\u3067\u3001\u300c\/\u300d\u306b\u7f6e\u304d\u63db\u3048\u308b\u306e\u304c\u6ce8\u610f\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u65e2\u5b58\u306e\u30a8\u30af\u30bb\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308c\u3070\u3001python\u306b\u3088\u3063\u3066\u30a8\u30af\u30bb\u30eb\u30c7\u30fc\u30bf\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>Python\u3092\u6d3b\u7528\u3057\u3066\u30a8\u30af\u30bb\u30eb\u64cd\u4f5c\u3059\u308b\u4e0a\u3067\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306e\u8aad\u307f\u8fbc\u307f\u306f\u57fa\u672c\u3068\u306a\u308b\u306e\u3067\u3001\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI\u3084\u6a5f\u68b0\u5b66\u7fd2\u3067\u306e\u591a\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308bPython\u306b\u306f\u591a\u6570\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u3001Excel\u306a\u3069\u306e\u8868\u8a08\u7b97\u30d6\u30c3\u30af\u306e\u64cd\u4f5c\u3082\u53ef\u80fd\u3067\u3059\u3002 Python\u306e\u30a8\u30af\u30bb\u30eb\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u6700\u3082\u6709\u540d\u306aopenpyxl\u3092\u4f7f\u3044\u3001\u65e2\u5b58\u306eExcel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1047],"tags":[1076,1069,25,108,195],"class_list":["post-6612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-load_workbook","tag-openpyxl","tag-windows","tag-108","tag-195"],"_links":{"self":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6612"}],"version-history":[{"count":3,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6612\/revisions"}],"predecessor-version":[{"id":6621,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6612\/revisions\/6621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/6613"}],"wp:attachment":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}