{"id":309,"date":"2015-12-07T23:59:57","date_gmt":"2015-12-07T14:59:57","guid":{"rendered":"http:\/\/blog.hiyowa.com\/?p=309"},"modified":"2016-12-14T14:47:12","modified_gmt":"2016-12-14T05:47:12","slug":"python%e5%88%9d%e5%bf%83%e8%80%85%e3%81%8c%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%82%92%e6%9b%b8%e3%81%84%e3%81%a6%e3%81%bf%e3%81%9f%e8%a9%b1","status":"publish","type":"post","link":"https:\/\/blog.hiyowa.com\/?p=309","title":{"rendered":"Python\u521d\u5fc3\u8005\u304c\u6b63\u898f\u8868\u73fe\u3092\u66f8\u3044\u3066\u307f\u305f\u8a71"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306f <a href=\"http:\/\/www.adventar.org\/calendars\/846\">Python Advent Calendar 2015<\/a> \u306e8\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e11\u6708\u3050\u3089\u3044\u304b\u3089\u3001Python\u3067\u8a00\u8a9e\u51e6\u7406100\u672c\u30ce\u30c3\u30af\u3092\u59cb\u3081\u305f\u521d\u5fc3\u8005\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3067\u76db\u5927\u306b\u8a70\u307e\u3063\u305f\u306e\u3067\u3001\u52c9\u5f37\u304c\u3066\u3089Linux\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<h3>1. sambaclient\u30b3\u30de\u30f3\u30c9<\/h3>\n<p>samba\u3068\u306f\u3001Unix\u7cfbOS\u304b\u3089Windows\u306e\u30d5\u30a1\u30a4\u30eb\u5171\u6709\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3059\u3002\u4f7f\u3044\u65b9\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u305f\u3068\u3048\u3070FTP\/SFTP\u306e\u3088\u3046\u306b\u5bfe\u8a71\u578b\u3067\u4f7f\u3044\u305f\u3044\u306a\u3089<\/p>\n<p>sambaclient \/\/\u30db\u30b9\u30c8\u540d\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea -U \u30e6\u30fc\u30b6\u540d<\/p>\n<p>\u3068\u3057\u307e\u3059\u3002\u3068\u3053\u308d\u304c\u3001\u30db\u30b9\u30c8\u540d\u304c\u7570\u69d8\u306b\u9577\u3044\u3088\u3046\u306a\u74b0\u5883\u3060\u3068\u3001\u6bce\u56de\u6253\u3064\u306e\u304c\u9762\u5012\u3067\u3059\u3002<\/p>\n<h3>2. smb\u30b3\u30de\u30f3\u30c9\u3092\u81ea\u4f5c<\/h3>\n<p>\u305d\u3053\u3067\u3001SSH\u306e.ssh\/config\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u3001\u305d\u306e\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u3067samba\u63a5\u7d9a\u3057\u3066\u304f\u308c\u308b\u30b3\u30de\u30f3\u30c9\u3092Python\u3067\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/KHiyowa\/smb\">GitHub<\/a><\/p>\n<p>\u898b\u3066\u306e\u901a\u308a\u306a\u306e\u3067\u3059\u304c\u3001\u307e\u305a.smb\/config\u3068\u3057\u3066\u3053\u3093\u306a\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<pre><code>Host clara\n    HostName  192.168.1.2\n    User      example\nHost ARIS\n    HostName  192.168.1.3<\/code><\/pre>\n<p>\u6d41\u308c\u3068\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li><code>\u300csmb \u30db\u30b9\u30c8\u540d \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u300d<\/code>\u3068\u3044\u3046\u30012\u3064\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u3092\u53d7\u3051\u53d6\u308b\u3002<\/li>\n<li>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u884c\u5358\u4f4d\u3067\u30ea\u30b9\u30c8\u306b\u683c\u7d0d<\/li>\n<li>\u4e00\u884c\u305a\u3064\u9001\u308a\u306a\u304c\u3089\u3001\u300cHost\u300d\u3067\u59cb\u307e\u3063\u3066\u300c\u30db\u30b9\u30c8\u540d(\u901a\u79f0) + \u6539\u884c\u300d\u3067\u7d42\u308f\u308b\u884c\u3092\u63a2\u3059\u3002\n<ol>\n<li>\u8a72\u5f53\u306e\u884c\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u3001\u30ea\u30b9\u30c8\u306e\u4e00\u3064\u5148\u3092\u53c2\u7167\u3057\u3066\u3001\u5b8c\u5168\u306a\u30db\u30b9\u30c8\u540d\u3092\u53d6\u5f97\u3059\u308b\u3002<\/li>\n<li>\u30ea\u30b9\u30c8\u306e2\u3064\u5148\u306b\u300cUser\u300d\u306e\u9805\u304c\u3042\u308c\u3070\u3001\u30ed\u30b0\u30a4\u30f3\u306b\u4f7f\u3046\u30e6\u30fc\u30b6\u540d\u3092\u53d6\u5f97\u3059\u308b\u3002<\/li>\n<li>\u30db\u30b9\u30c8\u540d\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3001\u3042\u308c\u3070\u30e6\u30fc\u30b6\u540d\u3092\u6307\u5b9a\u3057\u3066smbclient\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h3>3. \u8a70\u307e\u3063\u305f\u3068\u3053\u308d<\/h3>\n<p>\u3060\u3044\u305f\u3044\u4e00\u901a\u308a\u8a70\u307e\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3067\u306f\u3001C\u306e\u7656\u3067\u3064\u3044range(len())\u3068\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u304c\u3001readline\u3067\u8aad\u307f\u8fbc\u307f\u306a\u304c\u3089\u63a2\u3059\u306e\u304c\u304d\u308c\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u307e\u305f\u3001\u6539\u884c\u304c\u8aad\u307f\u8fbc\u307e\u308c\u308b\u306e\u3067\u53d6\u308a\u9664\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3053\u3068\u306b\u6c17\u3065\u304b\u305a\u3001\u304b\u306a\u308a\u624b\u9593\u53d6\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30db\u30b9\u30c8\u540d(\u901a\u79f0)\u3092\u63a2\u3059\u3068\u3053\u308d\u3067\u306f\u3001\u300cHost\u300d\u3068\u300c\u30db\u30b9\u30c8\u540d(\u901a\u79f0)\u300d\u304c\u4e21\u65b9\u542b\u307e\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u6761\u4ef6\u306b\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u3060\u3068\u3001\u30db\u30b9\u30c8\u540d(\u901a\u79f0)\u304c\u5b8c\u5168\u306a\u30db\u30b9\u30c8\u540d\u306e\u4e00\u90e8\u3060\u3063\u305f\u5834\u5408\u306b\u300cHostName\u300d\u306e\u884c\u3082\u30d2\u30c3\u30c8\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u306e\u3068\u3053\u308d\u30012\u3067\u793a\u3057\u305f\u5b9f\u88c5\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u6b63\u898f\u8868\u73fe\u3068\u5909\u6570\u304c\u6df7\u5728\u3057\u3066\u3044\u3066\u3082\u3001\u6b63\u898f\u8868\u73fe\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u3084\u308c\u3070\u4f7f\u3048\u308b\u306f\u305a\u306a\u306e\u3067\u3001\u3082\u3046\u5c11\u3057\u304d\u308c\u3044\u306b\u66f8\u3051\u308b\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n<p>lstrip\u306e\u4e2d\u8eab\u3092\u6b63\u898f\u8868\u73fe\u3067\u66f8\u3051\u3070\u3001\u30e6\u30fc\u30b6\u540d\u306e\u884c\u304b\u3089\u30e6\u30fc\u30b6\u540d\u3060\u3051\u62bd\u51fa\u3059\u308b\u306e\u3082\u7c21\u5358\u3060\u308d\u3046\u3068\u601d\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u4ed5\u65b9\u304c\u306a\u3044\u306e\u3067\u6b63\u898f\u8868\u73fe\u306b\u30de\u30c3\u30c1\u3057\u305f\u3068\u3053\u308d\u3092&#8221;&#8221;\u306b\u7f6e\u304d\u63db\u3048\u308b\u3068\u3044\u3046\u56de\u308a\u304f\u3069\u3044\u3053\u3068\u3092\u3057\u3066\u3044\u307e\u3059\u3002\u3069\u306a\u305f\u304b\u3084\u308a\u65b9\u6559\u3048\u3066\u304f\u3060\u3055\u3044&#8230;\u3002<\/p>\n<p>\u3053\u308c\u306f\u6b63\u898f\u8868\u73fe\u306f\u95a2\u4fc2\u306a\u3044\u306e\u3067\u3059\u304c\u3001Python3\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u65b9\u6cd5\u304c\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u3054\u5b58\u3058\u306e\u65b9\u662f\u975e\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u7d42\u308f\u308a\u306b<\/h3>\n<p>\u3044\u3044\u611f\u3058\u306b\u52c9\u5f37\u306b\u306a\u3063\u305f\u6c17\u304c\u3057\u307e\u3059\u304c\u3001\u3082\u3063\u3068\u304d\u308c\u3044\u306b\u66f8\u3051\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002\u73fe\u72b6\u3001\u52d5\u304b\u3057\u3066\u307f\u3066\u3046\u307e\u304f\u52d5\u304b\u306a\u3051\u308c\u3070\u3001\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30c6\u30b9\u30c8\u306e\u6f0f\u308c\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f5c\u3063\u3066\u307f\u305f\u3089\u5730\u5473\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306f Python Advent Calendar 2015 \u306e8\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u306e11\u6708\u3050\u3089\u3044\u304b\u3089\u3001Python\u3067\u8a00\u8a9e\u51e6\u7406100\u672c\u30ce\u30c3\u30af\u3092\u59cb\u3081\u305f\u521d\u5fc3\u8005\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3067\u76db\u5927\u306b\u8a70\u307e\u3063\u305f\u306e\u3067\u3001\u52c9\u5f37\u304c\u3066\u3089Lin &hellip; <a href=\"https:\/\/blog.hiyowa.com\/?p=309\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Python\u521d\u5fc3\u8005\u304c\u6b63\u898f\u8868\u73fe\u3092\u66f8\u3044\u3066\u307f\u305f\u8a71<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Python Advent Calendar 8\u65e5\u76ee \u521d\u5fc3\u8005 \u6b63\u898f\u8868\u73fe \u66f8\u3044\u3066\u307f\u305f","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[15],"class_list":["post-309","post","type-post","status-publish","format-standard","hentry","category-1","tag-advent-calendar"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4ICfx-4Z","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309"}],"version-history":[{"count":1,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":310,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/310"}],"wp:attachment":[{"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hiyowa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}