{"id":210,"date":"2019-02-13T16:04:23","date_gmt":"2019-02-13T16:04:23","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/python\/?p=210"},"modified":"2019-03-02T03:56:41","modified_gmt":"2019-03-02T03:56:41","slug":"19-python-file-operations","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/","title":{"rendered":"Python &#8211; File Operations"},"content":{"rendered":"<p>In this lesson we are going to learn different file operations such as how to rename and delete a file. We would also learn how to work with folders.<\/p>\n<p>We would cover the following:<\/p>\n<ol>\n<li><a href=\"#t1\">Renaming and Deleting Files<\/a><\/li>\n<li><a href=\"#t2\">Working with Directories<\/a><\/li>\n<li><a href=\"#t3\">Python File Methods<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">1. Renaming and Deleting a File<\/strong><\/h4>\n<p>The <em><strong>os<\/strong><\/em> module provides you with methods for performing various operations on file. For example, renaming a file or deleting a file.<\/p>\n<p>However, to use this methods, you must import the <em><strong>os<\/strong> <\/em>module using the command:<\/p>\n<p><span style=\"color: #800080;\">import os<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>The <em>rename()<\/em> Method<\/strong><\/p>\n<p>You use the rename() method to change the name of a file. The rename() method has two parameters. The current file_name and the new file_name.<\/p>\n<p>For example, the code below changes the filename from <em>old_filename.txt<\/em> to <em>new_filename.txt<\/em><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">os<\/span>\r\n\r\n<span style=\"color: #888888;\"># change the filename<\/span>\r\nos<span style=\"color: #333333;\">.<\/span>rename(<span style=\"background-color: #fff0f0;\">\"old_filename, new_filename.txt\"<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>The <em>remove()<\/em> Method<\/strong><\/p>\n<p>You can use the remove() for deleting files. The remove() methods takes only one parameter, that is the name of the file to be deleted.<\/p>\n<p>For example, the code below deletes the file named myfile.txt<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">import os\r\n\r\n<span style=\"color: #888888;\"># delete the file from disk<\/span>\r\nos<span style=\"color: #333333;\">.<\/span>remove(<span style=\"background-color: #fff0f0;\">\"myfile.txt\"<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Working with Directories<\/strong><\/h4>\n<p>Files are contained in directories(folders). The os module provides various functions to help you handle directories in Python. We would consider three operations:<\/p>\n<ul>\n<li>Create a directory<\/li>\n<li>Delete a directory<\/li>\n<li>Change a directory<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>The <em>mkdir()<\/em> Method<\/strong><\/p>\n<p>You can use mkdir() method to create new directory. When you use this method to create a new directory, the directory is created in the current directory. You need to provide the name of the directory to be created as argument to the mkdir() method.<\/p>\n<p>For example, the code below creates a directory named myfiles. I recommend you try it out.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">os<\/span>\r\n\r\n<span style=\"color: #888888;\"># create a new directory in the current path<\/span>\r\nos<span style=\"color: #333333;\">.<\/span>mkdir(<span style=\"background-color: #fff0f0;\">\"myfiles\"<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>The <em>chdir()<\/em> Method<\/strong><\/p>\n<p>You use the chdir() method to change the current directory. You must provide the name of the directory you want to set as the current directory.<\/p>\n<p>For example, the code below changes the current directory to D:\\data<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">os<\/span>\r\n\r\n<span style=\"color: #888888;\"># change the current directory to D:\/data<\/span>\r\nos<span style=\"color: #333333;\">.<\/span>chdir(<span style=\"background-color: #fff0f0;\">\"D:\/data\"<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>The <em>getcwd()<\/em> Method()<\/strong><\/p>\n<p>You use this method to display the current working directory.For example<\/p>\n<p>os.getcwd()<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The <em>rmdir()<\/em> Method<\/strong><\/p>\n<p>You can use the rmdir()\u00a0 to delete a directory from the disk. This method takes as parameter, the name of the directory you want to delete.<\/p>\n<p>For example, the code below deletes the directory &#8220;D:\/data&#8221;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">os<\/span>\r\n\r\n<span style=\"color: #888888;\"># delete the directory D:\/data<\/span>\r\nos<span style=\"color: #333333;\">.<\/span>rmdir(<span style=\"background-color: #fff0f0;\">\"D:\/data\"<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Python File Methods<\/strong><\/h4>\n<p>The are several function that you can use for file operations in python. Once you create a file object, then you can use these functions to manage them.<\/p>\n<p>Find the list below. I recommend you try each of them.<\/p>\n<p>&nbsp;<\/p>\n<table class=\"table table-bordered\" align=\"center\">\n<tbody>\n<tr style=\"background-color: #f7f6f3;\">\n<th>SN.<\/th>\n<th>Methods and brief description<\/th>\n<\/tr>\n<tr>\n<td class=\"ts\">1<\/td>\n<td><strong>file.close()<\/strong><\/p>\n<p>You can use this function to close a file.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">2<\/td>\n<td><strong>file.flush()<\/strong><\/p>\n<p>Flushes the internal buffer, like stdio&#8217;s fflush. This could be a no-op on some file-like objects.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">3<\/td>\n<td><strong>file.fileno()<\/strong><\/p>\n<p>Gives\u00a0 file descriptor that is used by the underlying implementation to request I\/O operations from the operating system. Returns an integer<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">4<\/td>\n<td><strong>file.isatty()<\/strong><\/p>\n<p>Returns True if the file is connected to a tty(-like) device. Otherwise, return false<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">5<\/td>\n<td><strong>file.next()<\/strong><\/p>\n<p>Returns the next line from the file each time it is called.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">6<\/td>\n<td><strong>file.read([size])<\/strong><\/p>\n<p>Reads at most\u00a0 the specified size bytes from the file (less if itreaches EOF before obtaining size bytes).<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">7<\/td>\n<td><strong>file.readline([size])<\/strong><\/p>\n<p>Reads one entire line of data from the file. Places a trailing in the string.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">8<\/td>\n<td><strong>file.readlines([sizehint])<\/strong><\/p>\n<p>Reads until the EOF using readline() and return a list containing the lines. If the optional sizehint argument is provided, then\u00a0 instead of reading up to EOF, whole lines totaling approximately sizehint bytes (possibly after rounding up to an internal buffer size) are read.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">9<\/td>\n<td><strong>file.seek(offset[, whence])<\/strong><\/p>\n<p>Sets the file&#8217;s current position to the specified offset<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">10<\/td>\n<td><strong>file.tell()<\/strong><\/p>\n<p>Returns the current file&#8217;s position<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">11<\/td>\n<td><strong>file.truncate([size])<\/strong><\/p>\n<p>Truncates the size of the file. If the optional size argument is present, the file is truncated to (at most) the given size.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">12<\/td>\n<td><strong>file.write(str)<\/strong><\/p>\n<p>Use this to writes a string onto the file. Does not return anything.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">13<\/td>\n<td><strong>file.writelines(sequence)<\/strong><\/p>\n<p>Writes a sequence of strings onto the file. The sequence may be any iterable object that produces strings, typically a list of strings.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson we are going to learn different file operations such as how to rename and delete a file. We would also learn how &hellip; <\/p>\n","protected":false},"author":395,"featured_media":211,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python - File Operations - Python Tutorials<\/title>\n<meta name=\"description\" content=\"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python - File Operations - Python Tutorials\" \/>\n<meta property=\"og:description\" content=\"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-13T16:04:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-02T03:56:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1005\" \/>\n\t<meta property=\"og:image:height\" content=\"544\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"headline\":\"Python &#8211; File Operations\",\"datePublished\":\"2019-02-13T16:04:23+00:00\",\"dateModified\":\"2019-03-02T03:56:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/\"},\"wordCount\":693,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/File-Operations.jpg\",\"articleSection\":[\"Python Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/\",\"name\":\"Python - File Operations - Python Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/File-Operations.jpg\",\"datePublished\":\"2019-02-13T16:04:23+00:00\",\"dateModified\":\"2019-03-02T03:56:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"description\":\"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/File-Operations.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/wp-content\\\/uploads\\\/sites\\\/8\\\/2019\\\/02\\\/File-Operations.jpg\",\"width\":1005,\"height\":544,\"caption\":\"File Operations in PYthon\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/19-python-file-operations\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python &#8211; File Operations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/\",\"name\":\"Python Tutorials\",\"description\":\"Python Tutorial for Programming and Data Science\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/python\\\/author\\\/kindsonthegenius-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python - File Operations - Python Tutorials","description":"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/","og_locale":"en_US","og_type":"article","og_title":"Python - File Operations - Python Tutorials","og_description":"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories","og_url":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/","og_site_name":"Python Tutorials","article_published_time":"2019-02-13T16:04:23+00:00","article_modified_time":"2019-03-02T03:56:41+00:00","og_image":[{"width":1005,"height":544,"url":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"headline":"Python &#8211; File Operations","datePublished":"2019-02-13T16:04:23+00:00","dateModified":"2019-03-02T03:56:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/"},"wordCount":693,"commentCount":1,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg","articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/","url":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/","name":"Python - File Operations - Python Tutorials","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg","datePublished":"2019-02-13T16:04:23+00:00","dateModified":"2019-03-02T03:56:41+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"description":"Learn about various file operations in Python. This includes reading and writing to file and working with directories. Creating and deleting directories","breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/python\/wp-content\/uploads\/sites\/8\/2019\/02\/File-Operations.jpg","width":1005,"height":544,"caption":"File Operations in PYthon"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/python\/19-python-file-operations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/python\/"},{"@type":"ListItem","position":2,"name":"Python &#8211; File Operations"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/python\/#website","url":"https:\/\/www.kindsonthegenius.com\/python\/","name":"Python Tutorials","description":"Python Tutorial for Programming and Data Science","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/python\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/python\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/python\/author\/kindsonthegenius-2\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/users\/395"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":1,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/posts\/210\/revisions\/212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media\/211"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/python\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}