{"id":31587,"date":"2022-10-13T09:22:22","date_gmt":"2022-10-13T09:22:22","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31587"},"modified":"2022-12-23T05:45:49","modified_gmt":"2022-12-23T05:45:49","slug":"python-tutorials-files-operations-using-os-module","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/python-tutorials-files-operations-using-os-module\/","title":{"rendered":"Python Tutorials: Files Operations using OS Module"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"403\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-1024x403.png\" alt=\"\" class=\"wp-image-31588\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-1024x403.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-300x118.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-768x302.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-1536x604.png 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-working-with-files-1-2048x806.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">File Operations using Python<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"800\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-file-operations-1024x800.png\" alt=\"\" class=\"wp-image-31574\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-file-operations-1024x800.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-file-operations-300x234.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-file-operations-768x600.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-file-operations.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"663\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-1-1024x663.jpg\" alt=\"\" class=\"wp-image-31589\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-1-1024x663.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-1-300x194.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-1-768x497.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-1.jpg 1179w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"313\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-2.png\" alt=\"\" class=\"wp-image-31590\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-2.png 448w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/10\/python-os-module-tutorial-2-300x210.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">About Python OS Module<\/h2>\n\n\n\n<p>The&nbsp;<strong>os<\/strong>&nbsp;module has many uses. We won\u2019t be covering everything that it can do. Instead, we will get an overview of its uses and we\u2019ll also take a look at one of its sub-modules, known as&nbsp;<strong>os.path<\/strong>. Specifically, we will be covering the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>os.name<\/li><li>os.environ<\/li><li>os.chdir()<\/li><li>os.getcwd()<\/li><li>os.getenv()<\/li><li>os.putenv()<\/li><li>os.mkdir()<\/li><li>os.makedirs()<\/li><li>os.remove()<\/li><li>os.rename()<\/li><li>os.rmdir()<\/li><li>os.startfile()<\/li><li>os.walk()<\/li><li>os.path<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/f89a57d0c101f3e392b52e4464225d68.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>File Operations using Python About Python OS Module The&nbsp;os&nbsp;module has many uses. We won\u2019t be covering everything that it can do. Instead, we will get an overview of its uses&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-31587","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=31587"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31587\/revisions"}],"predecessor-version":[{"id":31591,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31587\/revisions\/31591"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}