{"id":481,"date":"2023-02-16T11:14:48","date_gmt":"2023-02-16T11:14:48","guid":{"rendered":"https:\/\/tinyytopic.com\/?p=481"},"modified":"2023-02-16T11:14:38","modified_gmt":"2023-02-16T11:14:38","slug":"library-of-small-python-functions","status":"publish","type":"post","link":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/","title":{"rendered":"Library of small Python custom functions"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-887ad026     \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap\">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#how-to-open-a-folder-directory\">How to open a folder directory?<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-open-a-file-directory\">How to open a file directory?<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-find-a-string-between-two-characters-or-strings\">How to find a string between two characters or strings?<\/a><li class=\"uagb-toc__list\"><a href=\"#create-a-directory-if-not-exists\">Create a directory if not exists<\/a><li class=\"uagb-toc__list\"><a href=\"#access-the-index-of-an-element-in-for-loop\">Access the index of an element in &#8216;for&#8217; loop:<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-e67f1e45\"><h5 class=\"uagb-heading-text\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><br>How to open a folder directory?<\/mark><\/h5><\/div>\n\n\n\n<p style=\"font-size:15px\">A quick Python function to browse a folder:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def browse_open_folder_directory():\n    f_path = filedialog.askdirectory()\n    if not f_path: return\n    return f_path<\/pre>\n\n\n\n<p style=\"font-size:15px\">Write your main code as a sample below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tkinter import filedialog\n\nprint(browse_open_folder_directory())<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\">A sample output of the code is,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Downloads<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">How does the function work?<\/mark><\/p>\n\n\n\n<p style=\"font-size:15px\">The Python function <code>browse_open_folder_directory<\/code> does not take any arguments, but it opens a dialog box using the <code>filedialog<\/code> module of the <code>tkinter<\/code> library. The dialog box allows the user to browse their system to select a folder or directory.<\/p>\n\n\n\n<p style=\"font-size:15px\">Here is a breakdown of how the function works:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The <code>filedialog.askdirectory()<\/code> method is used to open a dialog box that allows the user to browse their system to select a folder or directory. This method returns the path of the selected folder or directory as a string.<\/li>\n\n\n\n<li>The <code>if<\/code> statement checks if the <code>f_path<\/code> variable contains a valid value (i.e., it is not <code>None<\/code>). If <code>f_path<\/code> is empty or <code>None<\/code>, the function immediately returns with no value.<\/li>\n\n\n\n<li>If the <code>f_path<\/code> variable contains a valid value, the function returns the value of <code>f_path<\/code>.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-b59c2125\"><h5 class=\"uagb-heading-text\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><br>How to open a file directory?<\/mark><\/h5><\/div>\n\n\n\n<p style=\"font-size:15px\">A quick Python function to browse a file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def browse_open_file_directory():\n    f_path = filedialog.askopenfilename()\n    if not f_path: return\n    return f_path<\/pre>\n\n\n\n<p style=\"font-size:15px\">Write your main code as a sample below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tkinter import filedialog\n\nprint(browse_open_file_directory())<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\">A sample output of the code is,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Downloads\\scaled_image.jpg<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">How does the function work?<\/mark><\/p>\n\n\n\n<p style=\"font-size:15px\">The Python function <code>browse_open_file_directory<\/code> does not take any arguments, but it opens a file dialog box using the <code>filedialog<\/code> module of the <code>tkinter<\/code> library. The dialog box allows the user to browse their system to select a file.<\/p>\n\n\n\n<p style=\"font-size:15px\">Here is a breakdown of how the function works:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The <code>filedialog.askopenfilename()<\/code> method is used to open a dialog box that allows the user to browse their system to select a file. This method returns the path of the selected file as a string.<\/li>\n\n\n\n<li>The <code>if<\/code> statement checks if the <code>f_path<\/code> variable contains a valid value (i.e., it is not <code>None<\/code>). If <code>f_path<\/code> is empty or <code>None<\/code>, the function immediately returns with no value.<\/li>\n\n\n\n<li>If the <code>f_path<\/code> variable contains a valid value, the function returns the value of <code>f_path<\/code>.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-e238da12\"><h5 class=\"uagb-heading-text\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><br>How to find a string between two characters or strings?<\/mark><\/h5><\/div>\n\n\n\n<p style=\"font-size:15px\">A quick Python function to find a string between two strings:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def find_string_between_chars(txt, first_char, last_char, start_location=0):\n    # Find a string between two characters in a text data\n    \n    output_char = 'Not found!'\n    EndLoc = 0\n    \n    InitLoc = txt.find(first_char, start_location) + len(first_char)\n    if InitLoc &lt; len(first_char): return output_char, EndLoc\n    \n    EndLoc = txt.find(last_char, InitLoc)\n    if EndLoc &lt; 1: return output_char, EndLoc\n    \n    output_char = txt[InitLoc:EndLoc]\n    output_char = ' '.join(output_char.split()) # replace continues white spaces with single space\n    \n    return output_char, EndLoc\n<\/pre>\n\n\n\n<p style=\"font-size:15px\">Write your main code as a sample below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>txt = \"The Python is a open source programming language!\"\nfirst_char = \"a \"\nlast_char = \"prog\"\n\noutput_char, end_loc = find_string_between_chars(txt, first_char, last_char)\n\nprint(output_char)\n<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\">The output of the code is,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"open source\"<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">How does the function work?<\/mark><\/p>\n\n\n\n<p>The Python function <code>find_string_between_chars<\/code> takes four parameters:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>txt<\/code>: a string in which the function will search for a substring located between two other substrings.<\/li>\n\n\n\n<li><code>first_char<\/code>: the substring that marks the beginning of the substring we want to extract.<\/li>\n\n\n\n<li><code>last_char<\/code>: the substring that marks the end of the substring we want to extract.<\/li>\n\n\n\n<li><code>start_location<\/code>: the index in <code>txt<\/code> where the search will begin. By default, it is set to 0.<\/li>\n<\/ol>\n\n\n\n<p>The function returns a tuple containing two values:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>output_char<\/code>: the substring located between <code>first_char<\/code> and <code>last_char<\/code>. If no such substring is found, the value is set to <code>'Not found!'<\/code>.<\/li>\n\n\n\n<li><code>EndLoc<\/code>: the index in <code>txt<\/code> where the search ended.<\/li>\n<\/ol>\n\n\n\n<p>Here&#8217;s a step-by-step explanation of how the function works:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The variable <code>output_char<\/code> is initialized to the string <code>'Not found!'<\/code>, and the variable <code>EndLoc<\/code> is initialized to 0.<\/li>\n\n\n\n<li>The variable <code>InitLoc<\/code> is set to the index of the first occurrence of <code>first_char<\/code> in <code>txt<\/code>, starting the search from the index given by <code>start_location<\/code>. The <code>find<\/code> method returns -1 if the substring is not found, so we add <code>len(first_char)<\/code> to <code>InitLoc<\/code> to get the index where the substring we want to extract begins. If <code>InitLoc<\/code> is less than <code>len(first_char)<\/code>, it means that <code>first_char<\/code> was not found, so we return the tuple <code>(output_char, EndLoc)<\/code>.<\/li>\n\n\n\n<li>The variable <code>EndLoc<\/code> is set to the index of the first occurrence of <code>last_char<\/code> in <code>txt<\/code>, starting the search from the index given by <code>InitLoc<\/code>. If <code>EndLoc<\/code> is less than 1, it means that <code>last_char<\/code> was not found, so we return the tuple <code>(output_char, EndLoc)<\/code>.<\/li>\n\n\n\n<li>The variable <code>output_char<\/code> is set to the substring of <code>txt<\/code> that starts at <code>InitLoc<\/code> and ends at <code>EndLoc<\/code>. We then use the <code>join<\/code> and <code>split<\/code> methods to remove any consecutive whitespace characters in the substring.<\/li>\n\n\n\n<li>We return the tuple <code>(output_char, EndLoc)<\/code>.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-ba4386b0\"><h5 class=\"uagb-heading-text\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><br>Create a directory if not exists<\/mark><\/h5><\/div>\n\n\n\n<p style=\"font-size:15px\">use the os module in Python to create a directory if it doesn&#8217;t exist already. Here&#8217;s an example function that takes a directory path as an argument and creates the directory if it doesn&#8217;t exist:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import os\n\ndef create_directory(path):\n    if not os.path.exists(path):\n        os.makedirs(path)\n<\/pre>\n\n\n\n<p style=\"font-size:15px\"><br>Write your main code as a sample below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create_directory(\"\/path\/to\/directory\")\n<\/code><\/pre>\n\n\n\n<p style=\"font-size:15px\">If the directory doesn&#8217;t exist, the function will create it and print a message saying that the directory was created. If the directory already exists, the function will print a message saying that the directory already exists.<\/p>\n\n\n\n<div class=\"wp-block-uagb-advanced-heading uagb-block-885939a7\"><h5 class=\"uagb-heading-text\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><br>Access the index of an element in &#8216;for&#8217; loop:<\/mark><\/h5><\/div>\n\n\n\n<p style=\"font-size:15px\">In Python, you can access the index of an element in a sequence when iterating through it using a <code>for<\/code> loop by using the built-in function <code>enumerate()<\/code>.<\/p>\n\n\n\n<p style=\"font-size:15px\"><br>To start the index from 0 (Zero):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fruits = ['apple', 'banana', 'cherry']\n\nfor index, fruit in enumerate(fruits):\n    print(index, fruit)<\/pre>\n\n\n\n<p style=\"font-size:15px\"><br>To start the index from 1 (One):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fruits = ['apple', 'banana', 'cherry']\n\nfor index, fruit in enumerate(fruits, start=1):\n    print(index, fruit)<\/pre>\n\n\n\n<p style=\"font-size:15px\">Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1 apple\r\n2 banana\r\n3 cherry\r<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A quick Python function to browse a folder: Write your main code as a sample below, A sample output of the code is, How does the function work? The Python function browse_open_folder_directory does not take any arguments, but it opens a dialog box using the filedialog module of the tkinter library. The dialog box allows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[12,17],"tags":[14,13,16,31,32,15],"class_list":["post-481","post","type-post","status-publish","format-standard","hentry","category-python","category-useful-function","tag-programming-language","tag-python","tag-python-code","tag-python-functions","tag-python-library","tag-python-sample-code"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Library of small Python custom functions - tinyytopic.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Library of small Python custom functions - tinyytopic.com\" \/>\n<meta property=\"og:description\" content=\"A quick Python function to browse a folder: Write your main code as a sample below, A sample output of the code is, How does the function work? The Python function browse_open_folder_directory does not take any arguments, but it opens a dialog box using the filedialog module of the tkinter library. The dialog box allows [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"tinyytopic.com\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-16T11:14:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-16T11:14:38+00:00\" \/>\n<meta name=\"author\" content=\"tinyytopic.com\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"tinyytopic.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/\",\"url\":\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/\",\"name\":\"Library of small Python custom functions - tinyytopic.com\",\"isPartOf\":{\"@id\":\"https:\/\/tinyytopic.com\/#website\"},\"datePublished\":\"2023-02-16T11:14:48+00:00\",\"dateModified\":\"2023-02-16T11:14:38+00:00\",\"author\":{\"@id\":\"https:\/\/tinyytopic.com\/#\/schema\/person\/56c840cea8539fb221a03c5fa2ef32eb\"},\"breadcrumb\":{\"@id\":\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tinyytopic.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Library of small Python custom functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tinyytopic.com\/#website\",\"url\":\"https:\/\/tinyytopic.com\/\",\"name\":\"tinyytopic.com\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tinyytopic.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tinyytopic.com\/#\/schema\/person\/56c840cea8539fb221a03c5fa2ef32eb\",\"name\":\"tinyytopic.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tinyytopic.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5f153681c8ca1e6d7287d858de51f968bb687221c89cf96d763ead4393881029?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5f153681c8ca1e6d7287d858de51f968bb687221c89cf96d763ead4393881029?s=96&d=mm&r=g\",\"caption\":\"tinyytopic.com\"},\"sameAs\":[\"http:\/\/tinyytopic.com\"],\"url\":\"https:\/\/tinyytopic.com\/index.php\/author\/mmkmuthukumar21gmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Library of small Python custom functions - tinyytopic.com","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:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/","og_locale":"en_US","og_type":"article","og_title":"Library of small Python custom functions - tinyytopic.com","og_description":"A quick Python function to browse a folder: Write your main code as a sample below, A sample output of the code is, How does the function work? The Python function browse_open_folder_directory does not take any arguments, but it opens a dialog box using the filedialog module of the tkinter library. The dialog box allows [&hellip;]","og_url":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/","og_site_name":"tinyytopic.com","article_published_time":"2023-02-16T11:14:48+00:00","article_modified_time":"2023-02-16T11:14:38+00:00","author":"tinyytopic.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"tinyytopic.com","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/","url":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/","name":"Library of small Python custom functions - tinyytopic.com","isPartOf":{"@id":"https:\/\/tinyytopic.com\/#website"},"datePublished":"2023-02-16T11:14:48+00:00","dateModified":"2023-02-16T11:14:38+00:00","author":{"@id":"https:\/\/tinyytopic.com\/#\/schema\/person\/56c840cea8539fb221a03c5fa2ef32eb"},"breadcrumb":{"@id":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tinyytopic.com\/index.php\/2023\/02\/16\/library-of-small-python-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tinyytopic.com\/"},{"@type":"ListItem","position":2,"name":"Library of small Python custom functions"}]},{"@type":"WebSite","@id":"https:\/\/tinyytopic.com\/#website","url":"https:\/\/tinyytopic.com\/","name":"tinyytopic.com","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tinyytopic.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tinyytopic.com\/#\/schema\/person\/56c840cea8539fb221a03c5fa2ef32eb","name":"tinyytopic.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tinyytopic.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5f153681c8ca1e6d7287d858de51f968bb687221c89cf96d763ead4393881029?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5f153681c8ca1e6d7287d858de51f968bb687221c89cf96d763ead4393881029?s=96&d=mm&r=g","caption":"tinyytopic.com"},"sameAs":["http:\/\/tinyytopic.com"],"url":"https:\/\/tinyytopic.com\/index.php\/author\/mmkmuthukumar21gmail-com\/"}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"tinyytopic.com","author_link":"https:\/\/tinyytopic.com\/index.php\/author\/mmkmuthukumar21gmail-com\/"},"uagb_comment_info":92,"uagb_excerpt":"A quick Python function to browse a folder: Write your main code as a sample below, A sample output of the code is, How does the function work? The Python function browse_open_folder_directory does not take any arguments, but it opens a dialog box using the filedialog module of the tkinter library. The dialog box allows&hellip;","_links":{"self":[{"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":11,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":487,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/posts\/481\/revisions\/487"}],"wp:attachment":[{"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tinyytopic.com\/index.php\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}