{"id":5219,"date":"2022-04-21T19:23:10","date_gmt":"2022-04-21T10:23:10","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=5219"},"modified":"2022-04-22T10:50:39","modified_gmt":"2022-04-22T01:50:39","slug":"xlwings-excel%e3%83%96%e3%83%83%e3%82%af%e3%81%ae%e3%83%91%e3%82%b9%e5%90%8d%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/5219","title":{"rendered":"[xlwings] Excel\u30d6\u30c3\u30af\u306e\u30d1\u30b9\u540d\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>Excel\u30a2\u30c9\u30a4\u30f3\u304b\u3089 xlwings \u3092\u8d77\u52d5\u3059\u308b\u3068\u30ab\u30ec\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u304c <code>python.exe<\/code> \/ <code>xlwings*.dll<\/code> \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d1\u30b9\u306b\u79fb\u52d5\u3059\u308b\u3002<\/p>\n<p>\u30a2\u30c9\u30a4\u30f3\u3092\u8d77\u52d5\u3057\u305fExcel\u30d5\u30a1\u30a4\u30eb\u3068\u540c\u3058\u968e\u5c64\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u66f8\u304d\u306b\u652f\u969c\u3092\u6765\u305f\u3059\u3002python\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089Excel\u3092\u8d77\u52d5\u3057\u305f\uff08Excel\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\uff09\u3068\u304d\u306f\u30ab\u30ec\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u306f\u79fb\u52d5\u3057\u306a\u3044\u3002<\/p>\n<pre class=\"lang:default decode:true \" >os.getcwd()\r\n# => 'C:\\Users\\UserName\\AppData\\Local\\Programs\\Python\\Python310'<\/pre>\n<p><!--more--><\/p>\n<h3>Python(xlwings)\u3092\u8d77\u52d5\u3057\u305f\u30d6\u30c3\u30af\uff08Excel\u30d5\u30a1\u30a4\u30eb\uff09\u306e\u30d1\u30b9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/h3>\n<pre class=\"lang:python decode:true \" >import xlwings as xw\r\nimport os\r\n\r\nwb = xw.Book.caller()\r\ncurrent_path = os.path.dirname(xb.fullname)\r\nfull_file_path = os.path.join(current_path, 'MyData.txt')<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Excel\u30a2\u30c9\u30a4\u30f3\u304b\u3089 xlwings \u3092\u8d77\u52d5\u3059\u308b\u3068\u30ab\u30ec\u30f3\u30c8\u30d5\u30a9\u30eb\u30c0\u304c python.exe \/ xlwings*.dll \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d1\u30b9\u306b\u79fb\u52d5\u3059\u308b\u3002 \u30a2\u30c9\u30a4\u30f3\u3092\u8d77\u52d5\u3057\u305fExcel\u30d5\u30a1\u30a4\u30eb\u3068\u540c\u3058\u968e\u5c64\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u8aad [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[52],"class_list":["post-5219","post","type-post","status-publish","format-standard","hentry","category-memo","tag-python"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=5219"}],"version-history":[{"count":11,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5219\/revisions"}],"predecessor-version":[{"id":5237,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/5219\/revisions\/5237"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=5219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=5219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=5219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}