{"id":2034,"date":"2019-05-19T06:57:53","date_gmt":"2019-05-19T04:57:53","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=2034"},"modified":"2023-07-26T13:29:00","modified_gmt":"2023-07-26T11:29:00","slug":"share-files-though-your-devices-with-python","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/share-files-though-your-devices-with-python\/","title":{"rendered":"Share files through your devices with Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can easily access to a shared folder among your devices with Python. You may want to share files among a pc and a tablet or another pc that you have connected on the same wifi. You can do it vey easily with Python.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Let&#8217;s see how<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the cmd and type<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>python -m http.server<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-29.png\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"349\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-29.png\" alt=\"\" class=\"wp-image-12918\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-29.png 839w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-29-320x133.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-29-768x319.png 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now open the browser and go to localhost:8000<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-31.png\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"543\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-31.png\" alt=\"\" class=\"wp-image-12920\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-31.png 482w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-31-320x360.png 320w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can have access to your files via the browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to get into that folder from another device<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Go in the cmd and type ipconfig<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-32.png\"><img loading=\"lazy\" decoding=\"async\" width=\"587\" height=\"172\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-32.png\" alt=\"\" class=\"wp-image-12921\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-32.png 587w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-32-320x94.png 320w\" sizes=\"auto, (max-width: 587px) 100vw, 587px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Find the address IpV4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is something like 168&#8230;&#8230; or whatever.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-33.png\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"234\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-33.png\" alt=\"\" class=\"wp-image-12922\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-33.png 686w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2023\/07\/image-33-320x109.png 320w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Go in the device you want to access to that folder and type in the browser:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">168&#8230;&#8230;&#8230;&#8230;:8000<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will see what is there in the folder of the other device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">files.<\/p>\n","protected":false},"excerpt":{"rendered":"Share folder&#8217;s content with Python using the http module. In this way you can see the files on your pc also on your tablet and your smartphone, with just a couple of instructions on the terminal.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/share-files-though-your-devices-with-python\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":1512,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[210,443],"tags":[392,393],"class_list":["post-2034","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-basics","category-chrome","tag-share-files","tag-share-folder"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=2034"}],"version-history":[{"count":6,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2034\/revisions"}],"predecessor-version":[{"id":12924,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/2034\/revisions\/12924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/1512"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=2034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=2034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=2034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}