{"id":741,"date":"2024-01-23T01:04:48","date_gmt":"2024-01-22T16:04:48","guid":{"rendered":"https:\/\/blog.peddals.com\/?p=741"},"modified":"2024-01-25T21:25:28","modified_gmt":"2024-01-25T12:25:28","slug":"build-flet-app-for-macos","status":"publish","type":"post","link":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/","title":{"rendered":"How to build Python GUI app on macOS with Flet"},"content":{"rendered":"\n<p>Flet version 1.18.0 released on the last day of year 2023 introduced a newer way of building apps that run on other computer, smartphone or website without setting up Python and Flet environment. I tried to build a macOS app and encountered a weird issue &#8212; a plain window opened with a text &#8220;Hello, Flet!&#8221; and I could not figure out how to fix it. A few days later, newer version 1.19.0 was released, and it had multiple fixes for <code>build<\/code> related issues. In this post I&#8217;d like to share how I built macOS app in Python with Flet. Once you set up your development environment, building process is really straight forward.<\/p>\n\n\n\n<p>Official announcement in discord: <a href=\"https:\/\/discord.com\/channels\/981374556059086931\/981375816489402408\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/discord.com\/channels\/981374556059086931\/981375816489402408<\/a><\/p>\n\n\n\n<p>Official GitHub change log: <a href=\"https:\/\/github.com\/flet-dev\/flet\/blob\/main\/CHANGELOG.md\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/flet-dev\/flet\/blob\/main\/CHANGELOG.md<\/a><\/p>\n\n\n\n<p>Official <code>flet build<\/code> guide: <a href=\"https:\/\/flet.dev\/docs\/guides\/python\/packaging-app-for-distribution\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/flet.dev\/docs\/guides\/python\/packaging-app-for-distribution<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick introduction of my sample code<\/h2>\n\n\n\n<p>As an example I&#8217;m going to use my simple <a href=\"https:\/\/github.com\/tokyohandsome\/passgen.py\/blob\/main\/README.md\" target=\"_blank\" rel=\"noreferrer noopener\">Password Generator<\/a> app. The main purpose of this post is to introduce how to build GUI app with Flet, so I&#8217;m not going to write about too much of this sample code. As you can see in the screenshot below, you can edit number of characters and special characters to use. Copy button copies the password to clipboard. It&#8217;s fun to see how strong passwords the app generates by checking with online services like this one (<a href=\"https:\/\/bitwarden.com\/ja-JP\/password-strength\/\" target=\"_blank\" rel=\"noreferrer noopener\">bitwarden<\/a>).<\/p>\n\n\n\n<p>If you&#8217;re interested you can grab the code from this GitHub: <a href=\"https:\/\/github.com\/tokyohandsome\/passgen.py\/blob\/main\/fletpassgen.py\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/tokyohandsome\/passgen.py\/blob\/main\/fletpassgen.py<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"529\" height=\"309\" src=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/82f7544228baa6c17e208d32d1ae5c1e.png\" alt=\"\" class=\"wp-image-711\" srcset=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/82f7544228baa6c17e208d32d1ae5c1e.png 529w, https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/82f7544228baa6c17e208d32d1ae5c1e-300x175.png 300w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><figcaption class=\"wp-element-caption\">Sample app you can build by following this guide. Number and special character set are editable.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Environment<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>macOS: 14.2.1<\/li>\n\n\n\n<li>Python: 3.11.6<\/li>\n\n\n\n<li>Python virtual environment: pipenv (version: 2023.10.24)<\/li>\n\n\n\n<li>Modules: flet (version: 0.19.0) <\/li>\n\n\n\n<li>Rosetta<\/li>\n\n\n\n<li>Xcode: 15.2<\/li>\n\n\n\n<li>Git: 2.29.2<\/li>\n\n\n\n<li>cocoapods: 1.14.3_1<\/li>\n\n\n\n<li>Flutter: 3.16.7<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">High level steps<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Build a virtual environment.<\/li>\n\n\n\n<li>Install Flet (version 0.18.0 or newer. 0.19.0 used in this post)<\/li>\n\n\n\n<li>Write a Flet app code or grab one.<\/li>\n\n\n\n<li>Test the code in your environment.<\/li>\n\n\n\n<li>Install requirements such as Flutter to build Flet app.<\/li>\n\n\n\n<li>Create a folder and work in there.<\/li>\n\n\n\n<li>Create <code>assets<\/code> folder and place an icon image.<\/li>\n\n\n\n<li>Copy your Flet code as main.py.<\/li>\n\n\n\n<li>Change the last part of main.py to <code>ft.app(main)<\/code>.<\/li>\n\n\n\n<li>Create <code>requirements.txt<\/code> and add required modules.<\/li>\n\n\n\n<li>Clone build template from official <a href=\"https:\/\/github.com\/flet-dev\/flet-build-template\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>.<\/li>\n\n\n\n<li>Edit copyright in the template.<\/li>\n\n\n\n<li>Build your app.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Little more detailed initial steps (#1~4)<\/h2>\n\n\n\n<p>Use your favorite virtual environment tool. Python version has to be 3.8 or newer. Install flet by executing <code>pip install flet<\/code> without specifying the version or <code>flet==1.19.0<\/code>. If you have not written your Flet app code yet, grab one from somewhere like the official site or from my GitHub if you&#8217;d like. In this post I&#8217;m going to use the fletpassgen.py as an example. Confirm it works by <code>python3 fletpassgen.py<\/code> then move forward.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install requirements such as Flutter to build Flet app. (step #5)<\/h2>\n\n\n\n<p>To build as a desktop\/smartphone\/web app, you need to install Flutter, Dart, and a few other stuff based on the <a href=\"https:\/\/docs.flutter.dev\/get-started\/install\/macos\/desktop?tab=download\" target=\"_blank\" rel=\"noreferrer noopener\">requirements<\/a>. Once this process is done, you don&#8217;t need to redo unless anything goes wrong. Below steps are for Apple Silicon macs specifically. Skip any step if you&#8217;re already done.<\/p>\n\n\n\n<p>1. <strong>Rosetta<\/strong>: Execute below to install.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>sudo softwareupdate --install-rosetta --agree-to-license<\/code><\/pre><\/div>\n\n\n\n<p>2.<strong> Xcode 15<\/strong>: Download Xcode 15 from Apple&#8217;s <a href=\"https:\/\/developer.apple.com\/xcode\/\" target=\"_blank\" rel=\"noreferrer noopener\">website<\/a>. Click on Download at the top of the page then double click on the installer.<\/p>\n\n\n\n<p>3. <strong>Cocoapods<\/strong>: Execute below to install.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>brew install cocoapods<\/code><\/pre><\/div>\n\n\n\n<p>4. <strong>Git<\/strong>: Execute below to install.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>brew install git<\/code><\/pre><\/div>\n\n\n\n<p>5. <strong>Flutter<\/strong>: Follow the <a href=\"https:\/\/docs.flutter.dev\/get-started\/install\/macos\/desktop?tab=download#install-the-flutter-sdk\" target=\"_blank\" rel=\"noreferrer noopener\">steps at the middle of the page<\/a> and download Flutter SDK for your CPU (Intel or Apple Silicon such as M1, M2, M3&#8230;). Move the zip file to somewhere like <code>~\/development\/<\/code>, unzip (double click), and add path to the commands to your <code>PATH<\/code> variable (rename <code>handsome<\/code> to your username, add below line to your <code>~\/.zshrc<\/code> then execute <code>source ~\/.zshrc<\/code> to load the setting).<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>export PATH=&quot;\/Users\/handsome\/development\/Flutter\/flutter\/bin:$PATH&quot;<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Preparation for build (steps #6~12)<\/h2>\n\n\n\n<p>When you&#8217;re done all the above steps, create an app folder, go inside and perform the remaining steps. In this example the app name is <code>fletpassgen<\/code>. <\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>mkdir fletpassgen\ncd fletpassgen\nmkdir assets\nopen assets<\/code><\/pre><\/div>\n\n\n\n<p>The above last command opens the assets folder in Finder where you can place a 512&#215;512 pixel icon image named like <code>icon.png<\/code> (supported formats include <code>.bmp<\/code>, <code>.jpg<\/code>, and <code>.webp<\/code>). I don&#8217;t have anything else, but you can place other resources such as audio and text files used by our code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Side note about icon: Flet can build app without an icon provided - it uses its own icon. I used <a href=\"https:\/\/github.com\/godly-devotion\/MochiDiffusion\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">Mochi Diffusion<\/a>, a desktop app version of the AI image generator Stable Diffusion to generate the app icon which is also the top of this post. Prompts, model, etc. can be found at the last part of this post.<\/pre>\n\n\n\n<p>Next, copy your Flet app code as <code>main.py<\/code>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>cp ..\/fletpassgen.py main.py<\/code><\/pre><\/div>\n\n\n\n<p>If the last line of the code to call the main function is not <code>ft.app(main)<\/code>, change so.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-file=\"main.py\" data-lang=\"Python\" data-start=\"99\"><code>#if __name__ == &quot;__main__&quot;:ft.app(target=main) &lt;-- this needs to be changed to the below:\nft.app(main)<\/code><\/pre><\/div>\n\n\n\n<p><code>requirements.txt<\/code> has to have needed Python module to run your Flet app, but <code>pip freeze &gt; requirements.txt<\/code> caused several errors for me. In this example, <code>flet<\/code> was only needed (other imported modules are Python built-in). See the official guide for details especially when you&#8217;re building iOS or Android app.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"requirements.txt\"><code>flet<\/code><\/pre><\/div>\n\n\n\n<p>You can clone the build template from the official <a href=\"https:\/\/github.com\/flet-dev\/flet-build-template\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a> to your local folder and edit copyright which can be shown by Command + I (macOS). Use your favorite editor if you are not good at the vi (vim) editor. <\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-zsh\" data-lang=\"ZSH\"><code>git clone https:\/\/github.com\/flet-dev\/flet-build-template\nvi flet-build-template\/cookiecutter.json<\/code><\/pre><\/div>\n\n\n\n<p>I edited highlighted lines 7-9 of <code>cookiecutter.json<\/code> in the flet-build-template folder.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"cookiecutter.json\" data-line=\"7-9\"><code>{\n    &quot;out_dir&quot;: &quot;&quot;,\n    &quot;python_module_name&quot;: &quot;main&quot;,\n    &quot;project_name&quot;: &quot;&quot;,\n    &quot;project_description&quot;: &quot;&quot;,\n    &quot;product_name&quot;: &quot;{{ cookiecutter.project_name }}&quot;,\n    &quot;org_name&quot;: &quot;com.peddals&quot;,\n    &quot;company_name&quot;: &quot;Peddals.com&quot;,\n    &quot;copyright&quot;: &quot;Copyright (c) 2024 Peddals.com&quot;,\n    &quot;sep&quot;: &quot;\/&quot;,\n    &quot;kotlin_dir&quot;: &quot;{{ cookiecutter.org_name.replace(&#39;.&#39;, cookiecutter.sep) }}{{ cookiecutter.sep }}{{ cookiecutter.project_name }}{{ cookiecutter.sep }}&quot;,\n    &quot;hide_loading_animation&quot;: true,\n    &quot;team_id&quot;: &quot;&quot;,\n    &quot;base_url&quot;: &quot;\/&quot;,\n    &quot;route_url_strategy&quot;: &quot;path&quot;,\n    &quot;web_renderer&quot;: &quot;canvaskit&quot;,\n    &quot;use_color_emoji&quot;: &quot;false&quot;\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Build your app (final step #13)<\/h2>\n\n\n\n<p>If you don&#8217;t care of options, simply execute <code>flet build macos<\/code> and you get an executable app. Below longer command adds version number and the above edited copyright. (Correction on Jan 25, 2024, thanks to the <a href=\"https:\/\/github.com\/flet-dev\/flet\/issues\/2437\" target=\"_blank\" rel=\"noreferrer noopener\">issue answered by the author<\/a>.) To specify the build template location, use <code>--template<\/code> option followed by a relative path.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-zsh\" data-lang=\"ZSH\"><code>flet build macos --build-version &quot;1.0.1&quot; --template flet-build-template<\/code><\/pre><\/div>\n\n\n\n<p>Give it some time to complete and when you see <code>Success!<\/code> congrats, your app is built! Under <code>build\/macos\/<\/code> you can find your app <code>fletpassgen.app<\/code>. It took around 3 mins and 10 secs to build it on my M1 mac mini. Output of the successful build process log is like below:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>Creating Flutter bootstrap project...OK\nCustomizing app icons and splash images...OK\nGenerating app icons...OK\nPackaging Python app...OK\nBuilding macOS bundle...OK\nCopying build to build\/macos directory...OK\nSuccess!<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"191\" src=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b4bb2179da4e7cf6d1d4ad04b9249383-1024x191.png\" alt=\"\" class=\"wp-image-720\" srcset=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b4bb2179da4e7cf6d1d4ad04b9249383-1024x191.png 1024w, https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b4bb2179da4e7cf6d1d4ad04b9249383-300x56.png 300w, https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b4bb2179da4e7cf6d1d4ad04b9249383-768x143.png 768w, https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b4bb2179da4e7cf6d1d4ad04b9249383.png 1384w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Screenshot in color<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">App is Universal<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"267\" height=\"459\" src=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b8f3d924e2c0110522ae74c85296ea80.png\" alt=\"\" class=\"wp-image-721\" srcset=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b8f3d924e2c0110522ae74c85296ea80.png 267w, https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/b8f3d924e2c0110522ae74c85296ea80-175x300.png 175w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><figcaption class=\"wp-element-caption\">Type: Application (Universal). See version 1.0.1 and Copyright (by Cmd + I) as well.<\/figcaption><\/figure>\n\n\n\n<p>Just like other mac apps, you can move the app to your Applications folder and double-click to launch. I was not asked to approve in the Privacy and Security. Not tested yet, but it should run on an Intel mac as well since it&#8217;s a Universal app. It opens and works just like the Python code. My sample app opens the Flet default size window momentarily then resizes as specified &#8211; I suppose there&#8217;s a better way to code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Do I like it?<\/h2>\n\n\n\n<p>I love it! I used to use tkinter and pysimplegui to build desktop apps, but Flet is much easier with better looking\/modern interface. Building process is straight forward, and app works great. Just like 3D printer changed productivity of nonprofessional DIYers in the real world, Flet lets you make your ideas real on your computer and share with your family, friends, colleagues and others. Hope you find it useful and enjoy as well!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Image by Stable Diffusion<\/h2>\n\n\n\n<p>Date:<br>2024-Jan-15 23:05:04<\/p>\n\n\n\n<p>Model:<br>realisticVision-v20_split-einsum<\/p>\n\n\n\n<p>Size:<br>512 x 512<\/p>\n\n\n\n<p>Include in Image:<br>masterpiece, best quality, retro future, cyber, disco computer, password generator<\/p>\n\n\n\n<p>Exclude from Image:<\/p>\n\n\n\n<p>Seed:<br>3224310018<\/p>\n\n\n\n<p>Steps:<br>20<\/p>\n\n\n\n<p>Guidance Scale:<br>20.0<\/p>\n\n\n\n<p>Scheduler:<br>DPM-Solver++<\/p>\n\n\n\n<p>ML Compute Unit:<br>CPU &amp; Neural Engine<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flet version 1.18.0 released on the last day of year 2023 introduced a newer way of building apps that run on  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to build Python GUI app on macOS with Flet&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":725,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/blog.peddals.com\/?p=709","footnotes":""},"categories":[24,8,4],"tags":[12,18],"class_list":["post-741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flet","category-macos","category-python","tag-mac","tag-python","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to build Python GUI app on macOS with Flet | Peddals Blog<\/title>\n<meta name=\"description\" content=\"Building Python GUI app with Flet on macOS. I love it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build Python GUI app on macOS with Flet | Peddals Blog\" \/>\n<meta property=\"og:description\" content=\"Building Python GUI app with Flet on macOS. I love it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/\" \/>\n<meta property=\"og:site_name\" content=\"Peddals Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-22T16:04:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-25T12:25:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Handsome\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Handsome\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"21 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/\"},\"author\":{\"name\":\"Handsome\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"headline\":\"How to build Python GUI app on macOS with Flet\",\"datePublished\":\"2024-01-22T16:04:48+00:00\",\"dateModified\":\"2024-01-25T12:25:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/\"},\"wordCount\":1130,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/icon.jpg\",\"keywords\":[\"mac\",\"Python\"],\"articleSection\":[\"Flet\",\"macOS\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/\",\"name\":\"How to build Python GUI app on macOS with Flet | Peddals Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/icon.jpg\",\"datePublished\":\"2024-01-22T16:04:48+00:00\",\"dateModified\":\"2024-01-25T12:25:28+00:00\",\"description\":\"Building Python GUI app with Flet on macOS. I love it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/icon.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/icon.jpg\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/build-flet-app-for-macos\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/blog.peddals.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build Python GUI app on macOS with Flet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/\",\"name\":\"Peddals Blog\",\"description\":\"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.peddals.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\",\"name\":\"Handsome\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"caption\":\"Handsome\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to build Python GUI app on macOS with Flet | Peddals Blog","description":"Building Python GUI app with Flet on macOS. I love it.","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:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/","og_locale":"en_US","og_type":"article","og_title":"How to build Python GUI app on macOS with Flet | Peddals Blog","og_description":"Building Python GUI app with Flet on macOS. I love it.","og_url":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/","og_site_name":"Peddals Blog","article_published_time":"2024-01-22T16:04:48+00:00","article_modified_time":"2024-01-25T12:25:28+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg","type":"image\/jpeg"}],"author":"Handsome","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Handsome","Est. reading time":"21 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#article","isPartOf":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/"},"author":{"name":"Handsome","@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"headline":"How to build Python GUI app on macOS with Flet","datePublished":"2024-01-22T16:04:48+00:00","dateModified":"2024-01-25T12:25:28+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/"},"wordCount":1130,"commentCount":0,"publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg","keywords":["mac","Python"],"articleSection":["Flet","macOS","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/","url":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/","name":"How to build Python GUI app on macOS with Flet | Peddals Blog","isPartOf":{"@id":"https:\/\/blog.peddals.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#primaryimage"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg","datePublished":"2024-01-22T16:04:48+00:00","dateModified":"2024-01-25T12:25:28+00:00","description":"Building Python GUI app with Flet on macOS. I love it.","breadcrumb":{"@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#primaryimage","url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg","contentUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/01\/icon.jpg","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peddals.com\/en\/build-flet-app-for-macos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/blog.peddals.com\/"},{"@type":"ListItem","position":2,"name":"How to build Python GUI app on macOS with Flet"}]},{"@type":"WebSite","@id":"https:\/\/blog.peddals.com\/#website","url":"https:\/\/blog.peddals.com\/","name":"Peddals Blog","description":"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English","publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.peddals.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994","name":"Handsome","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","caption":"Handsome"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":37,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/741\/revisions"}],"predecessor-version":[{"id":794,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/741\/revisions\/794"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media\/725"}],"wp:attachment":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/categories?post=741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/tags?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}