{"id":1048,"date":"2023-03-31T21:31:00","date_gmt":"2023-03-31T16:01:00","guid":{"rendered":"https:\/\/geekpython.in\/?p=1048"},"modified":"2023-08-15T13:42:12","modified_gmt":"2023-08-15T08:12:12","slug":"seek-and-tell-in-python","status":"publish","type":"post","link":"https:\/\/geekpython.in\/seek-and-tell-in-python","title":{"rendered":"Difference Between seek() &amp; tell() And How To Use"},"content":{"rendered":"\n<p>Python provides methods and functions to handle files. Handling files includes operations like opening a file, after that reading the content, adding or overwriting the content and then finally closing the file.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-geekpython wp-block-embed-geekpython\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"oceanwp-oembed-wrap clr\"><blockquote class=\"wp-embedded-content\" data-secret=\"fjbdxe6o9T\"><a href=\"https:\/\/geekpython.in\/handling-files-in-python\">Handling Files In Python &#8211; Opening, Reading &amp; Writing<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Handling Files In Python &#8211; Opening, Reading &amp; Writing&#8221; &#8212; GeekPython\" src=\"https:\/\/geekpython.in\/handling-files-in-python\/embed#?secret=MwKGNIg6GN#?secret=fjbdxe6o9T\" data-secret=\"fjbdxe6o9T\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>By using the&nbsp;<code>read()<\/code>&nbsp;function or by iterating over each line we can read the content of the file. The point of saying this is that there are several ways to present the program&#8217;s output.<\/p>\n\n\n\n<p>What if we want to read the file from a specific position or find out from where the reading begins? Python&#8217;s&nbsp;<code>seek()<\/code>&nbsp;and&nbsp;<code>tell()<\/code>&nbsp;functions come in handy here.<\/p>\n\n\n\n<p>In this article, we&#8217;ll look at the differences and applications of Python&#8217;s&nbsp;<code>seek()<\/code>&nbsp;and&nbsp;<code>tell()<\/code>&nbsp;functions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-sample-file\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-sample-file\"><\/a>Sample File<\/h2>\n\n\n\n<p>We&#8217;ll be using the&nbsp;<code>sample.txt<\/code>&nbsp;file, which contains the information shown in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"254\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/sampledata.png\" alt=\"Sample data\" class=\"wp-image-1051\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/sampledata.png 1022w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/sampledata-300x75.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/sampledata-768x191.png 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-seek\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-seek\"><\/a>seek<\/h2>\n\n\n\n<p>The&nbsp;<code>seek()<\/code>&nbsp;function in Python is used to&nbsp;<strong>move the file cursor to the specified location<\/strong>. When we read a file, the cursor starts at the beginning, but we can move it to a specific position by passing an arbitrary integer (based on the length of the content in the file) to the&nbsp;<code>seek()<\/code>&nbsp;function.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/seek-1024x546.png\" alt=\"Visual representation of the seek function\" class=\"wp-image-1052\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/seek-1024x546.png 1024w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/seek-300x160.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/seek-768x410.png 768w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/seek.png 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Visual representation of the seek function<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file for reading\nwith open('sample.txt', 'r') as file:\n    # Setting the cursor at 62nd position\n    file.seek(62)\n    # Reading the content after the 62nd character\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p>We&#8217;ve moved the cursor to the 62nd position, which means that if we read the file, we&#8217;ll begin reading after the 62nd character.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"206\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/output-1.png\" alt=\"Output content\" class=\"wp-image-1053\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/output-1.png 818w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/output-1-300x76.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/output-1-768x193.png 768w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-syntax\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-syntax\"><\/a>Syntax<\/h3>\n\n\n\n<p><code>seek(offset, whence)<\/code><\/p>\n\n\n\n<p>Here,<\/p>\n\n\n\n<p><code>offset<\/code>&nbsp;&#8211; Required parameter. Sets the cursor to the specified position and starts reading after that position.<\/p>\n\n\n\n<p><code>whence<\/code>&nbsp;&#8211; Optional parameter. It is used to set the point of reference to start from which place.<\/p>\n\n\n\n<p><code>0<\/code>&nbsp;&#8211; Default. Sets the point of reference at the beginning of the file. Equivalent to&nbsp;<code>os.SEEK_SET<\/code>.<\/p>\n\n\n\n<p><code>1<\/code>&nbsp;&#8211; Sets the point of reference at the current position of the file. Equivalent to&nbsp;<code>os.SEEK_CUR<\/code>.<\/p>\n\n\n\n<p><code>2<\/code>&nbsp;&#8211; Sets the point of reference at the end of the file. Equivalent to&nbsp;<code>os.SEEK_END<\/code>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Note: We cannot set the&nbsp;<strong>point of reference<\/strong>&nbsp;<code>1<\/code>&nbsp;or&nbsp;<code>2<\/code>&nbsp;when a file is opened in&nbsp;<strong>text mode<\/strong>, but we can specify&nbsp;<code>1<\/code>&nbsp;or&nbsp;<code>2<\/code>&nbsp;when the&nbsp;<strong>offset<\/strong>&nbsp;is set to&nbsp;<code>0<\/code>.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-more-examples\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-more-examples\"><\/a>More examples<\/h3>\n\n\n\n<p>We&#8217;ll see examples where we can experiment with these parameter values to better understand how they work.<\/p>\n\n\n\n<p><strong>Example 1 &#8211; Seek relative to the current position in text mode<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file for reading\nwith open('sample.txt', 'r') as file:\n    # Setting the cursor at 62nd position and sets the reference point equal to 1\n    file.seek(62, 1)\n    # Reading the content after the 62nd character\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p>We opened the file in&nbsp;<strong>text mode<\/strong>, moved the cursor to the 62nd position, and set the reference point as the file&#8217;s current position. Then we attempted to open the file.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">Traceback (most recent call last):\n  ....\n    file.seek(62, 1)\nio.UnsupportedOperation: can't do nonzero cur-relative seeks<\/pre><\/div>\n\n\n\n<p>Python returned an error message stating that this operation is not supported because seek relative to the current position cannot be performed with a number other than 0. If we specify a&nbsp;<strong>reference point equal to 2<\/strong>, the result will be the same.<\/p>\n\n\n\n<p>However, if we had opened the file in binary mode, the above code would have been executed without error.<\/p>\n\n\n\n<p><strong>Example 2 &#8211; Seek relative to the current position in binary mode<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file for reading in binary mode\nwith open('sample.txt', 'rb') as file:\n    \"\"\"Setting the cursor at 62nd position and \n    setting the reference point equal to 1\"\"\"\n    file.seek(62, 1)\n    # Reading the content after the 62nd character\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">b'Its design philosophy emphasizes code readability with the use of significant indentation.'<\/pre><\/div>\n\n\n\n<p><strong>Example 3 &#8211; Specifying the negative offset value.<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file for reading in binary mode\nwith open('sample.txt', 'rb') as file:\n    # Setting the cursor at 25th position from the end\n    file.seek(-25, 2)\n    # Reading the content\n    data = file.read()\n    print(data)\n\n----------\nb' significant indentation.'<\/pre><\/div>\n\n\n\n<p>The reference point is at the 25th position from the end. We got the output characters up to the 25th position to the left of the file&#8217;s end.<\/p>\n\n\n\n<p><strong>Example 4<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file for reading in binary mode\nwith open('sample.txt', 'rb') as file:\n    # Setting the cursor at 50th position\n    file.seek(50)\n    # Moving back 10 chars from the current position\n    file.seek(-10, 1)\n    # Reading the content\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">b'programming language. Its design philosophy emphasizes code readability with the use of significant indentation.'<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-tell\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-tell\"><\/a>tell<\/h2>\n\n\n\n<p>The&nbsp;<code>seek()<\/code>&nbsp;function is used to set the position of the file cursor, whereas the&nbsp;<code>tell()<\/code>&nbsp;function&nbsp;<strong>returns the position where the cursor is set to begin reading<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/tell-1024x546.png\" alt=\"Visual presentation of the tell function\" class=\"wp-image-1054\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/tell-1024x546.png 1024w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/tell-300x160.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/tell-768x410.png 768w, https:\/\/geekpython.in\/wp-content\/uploads\/2023\/08\/tell.png 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Visual presentation of the tell function<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file\nwith open('sample.txt', 'r') as file:\n    # Using tell() function\n    pos = file.tell()\n    # Printing the position of the cursor\n    print(f'File cursor position: {pos}')\n    # Printing the content\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">File cursor position: 0\nPython is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-syntax-1\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-syntax-1\"><\/a>Syntax<\/h3>\n\n\n\n<p><code>tell()<\/code><\/p>\n\n\n\n<p>The&nbsp;<code>tell()<\/code>&nbsp;function takes no parameter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-examples\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-examples\"><\/a>Examples<\/h3>\n\n\n\n<p>As previously stated, we can use the&nbsp;<code>tell()<\/code>&nbsp;function to return the cursor position set by the&nbsp;<code>seek()<\/code>&nbsp;function. To determine the position of the cursor, we&#8217;ll experiment with the&nbsp;<code>seek()<\/code>&nbsp;function parameter values.<\/p>\n\n\n\n<p><strong>Example 1 &#8211; Setting cursor position from the end and printing the cursor position<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file in binary mode\nwith open('sample.txt', 'rb') as file:\n    # Setting cursor at the 25th pos from the end\n    file.seek(-25, 2)\n    # Using tell() function\n    pos = file.tell()\n    # Printing the position of the cursor\n    print(f'File cursor position: {pos}')\n    # Printing the content\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">File cursor position: 127\nb' significant indentation.<\/pre><\/div>\n\n\n\n<p>The character at the 25th position from the end begins after the 127th character from the beginning, that&#8217;s why we got the cursor position as 127.<\/p>\n\n\n\n<p><strong>Example 2<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \"># Opening a file in binary mode\nwith open('sample.txt', 'rb') as file:\n    # Setting cursor at the 100th pos\n    file.seek(100)\n    print(f'File cursor position before: {file.tell()}')\n    # Moving back 15 chars from the current position\n    file.seek(-15, 1)\n    # Using tell() function\n    pos = file.tell()\n    # Printing the position of the cursor\n    print(f'File cursor position now: {pos}')\n    # Printing the content\n    data = file.read()\n    print(data)<\/pre><\/div>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">File cursor position before: 100\nFile cursor position now: 85\nb'mphasizes code readability with the use of significant indentation.'<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-difference\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-difference\"><\/a>Difference<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><td>seek()<\/td><td>tell()<\/td><\/tr><\/thead><tbody><tr><td>Used to set the file cursor to the specific position.<\/td><td>Used to tell the position of the file cursor.<\/td><\/tr><tr><td>Takes two parameters: the first is&nbsp;<code>offset<\/code>&nbsp;and the second is&nbsp;<code>whence<\/code>.<\/td><td>Takes no parameter<\/td><\/tr><tr><td>By using&nbsp;<code>seek()<\/code>&nbsp;function, we can manipulate the reading position of the file&#8217;s content.<\/td><td>By using the&nbsp;<code>tell()<\/code>&nbsp;function, we can only get the position of the file cursor.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-conclusion\"><a href=\"https:\/\/geekpython.in\/seek-and-tell-in-python#heading-conclusion\"><\/a>Conclusion<\/h2>\n\n\n\n<p>The article discussed the differences between&nbsp;<code>seek()<\/code>&nbsp;and&nbsp;<code>tell()<\/code>&nbsp;functions, as well as how to use them effectively to handle file data. These two functions are completely distinct from one another.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83c\udfc6<strong>Other articles you might be interested in if you liked this one<\/strong><\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/tempfile-in-python\" rel=\"noreferrer noopener\">Generate temporary files and directories using tempfile in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/abc-in-python\" rel=\"noreferrer noopener\">Creating and implementing abstract classes in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/implement-getitem-setitem-and-delitem-in-python\" rel=\"noreferrer noopener\">How to use getitem, setitem and delitem in Python<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/super-in-python\" rel=\"noreferrer noopener\">How to use super() function in Python classes<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/integrate-postgresql-database-in-python\" rel=\"noreferrer noopener\">How to integrate the PostgreSQL database with Python<\/a>?<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/argparse-in-python\" rel=\"noreferrer noopener\">Build your command line interface in a few steps<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/shutil-module-in-python\" rel=\"noreferrer noopener\">Perform high-level file operation using the shutil in Python<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>That&#8217;s all for now<\/strong><\/p>\n\n\n\n<p><strong>Keep Coding\u270c\u270c<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python provides methods and functions to handle files. Handling files includes operations like opening a file, after that reading the content, adding or overwriting the content and then finally closing the file. By using the&nbsp;read()&nbsp;function or by iterating over each line we can read the content of the file. The point of saying this is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1050,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[2,41],"tags":[44,12,31],"class_list":["post-1048","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-function","tag-files","tag-python","tag-python3","entry","has-media"],"_links":{"self":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/comments?post=1048"}],"version-history":[{"count":3,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1048\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1048\/revisions\/1301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media\/1050"}],"wp:attachment":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media?parent=1048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/categories?post=1048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/tags?post=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}