{"id":139,"date":"2023-01-16T06:53:15","date_gmt":"2023-01-15T21:53:15","guid":{"rendered":"https:\/\/global-hack.com\/blog\/?p=139"},"modified":"2023-01-16T06:58:13","modified_gmt":"2023-01-15T21:58:13","slug":"%e3%80%90python%e3%80%91venv%e3%81%a7flet%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e3%82%92%e7%a7%92%e9%80%9f%e6%a7%8b%e7%af%89%ef%bc%86%e7%b0%a1%e6%98%93%e3%82%a2%e3%83%97%e3%83%aa%e4%bd%9c%e6%88%90","status":"publish","type":"post","link":"https:\/\/global-hack.com\/blog\/archives\/139","title":{"rendered":"\u3010Python\u3011venv\u3067Flet\u958b\u767a\u74b0\u5883\u3092\u79d2\u901f\u69cb\u7bc9\uff06\u7c21\u6613\u30a2\u30d7\u30ea\u4f5c\u6210\u3057\u3066\u307f\u305f\u3010Flutter\u3011"},"content":{"rendered":"<h3>Flet\u3068\u306f\u306a\u306b\u304b\uff1f<\/h3>\n<p>Python\u3092\u4f7f\u3063\u3066Flutter\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3067\u304d\u308b\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/flet.dev\/\" target=\"_blank\" rel=\"nofollow noopener\" title=\"Flet\u516c\u5f0f\u30b5\u30a4\u30c8\">Flet\u516c\u5f0f\u30b5\u30a4\u30c8<\/a><\/p>\n<p><a href=\"https:\/\/flutter.dev\/\" target=\"_blank\" rel=\"nofollow noopener\" title=\"Flutter\u516c\u5f0f\u30b5\u30a4\u30c8\">Flutter<\/a>\u306f\u3001Google\u304c\u958b\u767a\u3057\u305f<a href=\"https:\/\/dart.dev\/\" title=\"Dart\u516c\u5f0f\u30b5\u30a4\u30c8\">Dart<\/a>\u3068\u3044\u3046\u8a00\u8a9e\u3092\u4f7f\u3063\u3066\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3053\u306eFlutter\u306f\u3001\u69d8\u3005\u306a\u30c7\u30d0\u30a4\u30b9\uff08Android\u30fbiOS\u30fbMac\u30fbWindows\u30fbLinux\uff09\u306b\u5bfe\u5fdc\u53ef\u80fd\u306a\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u30a2\u30d7\u30ea\u958b\u767a\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Flet\u3067\u306f\u4e0a\u8ff0\u306e\u3088\u3046\u306bFlutter\u958b\u767a\u304c\u53ef\u80fd\u3067\u3042\u308a\u3001\u304b\u3064<a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"nofollow noopener\" title=\"Python\u516c\u5f0f\u30b5\u30a4\u30c8\">Python<\/a>\u3068\u3044\u3046\u66f8\u304d\u5473\u92ed\u3044\u8a00\u8a9e\u3068\u8c4a\u5bcc\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7528\u3044\u308b\u305f\u3081\u958b\u767a\u3082\u304b\u306a\u308a\u6357\u308b\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u307e\u305a\u958b\u767a\u74b0\u5883\u3092\u6574\u3048\u3066\u304b\u3089\u5b9f\u969b\u306bFlet\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u5b9f\u884c\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h3>Flet\u7528\u306b\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b<\/h3>\n<p>\u4e0b\u8a18\u30ea\u30f3\u30af\u3092\u53c2\u7167\u3057\u3001venv\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"xDuccf0G3L\"><p><a href=\"https:\/\/global-hack.com\/blog\/archives\/93\">\u3010\u7c21\u5358Python\u3011venv\u3067\u30b5\u30af\u30c3\u3068\u4eee\u60f3\u74b0\u5883\u3092\u7528\u610f\u3057\u3066\u307f\u308b\u3010Mac\u958b\u767a\u74b0\u5883\u69cb\u7bc9\u3011<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u3010\u7c21\u5358Python\u3011venv\u3067\u30b5\u30af\u30c3\u3068\u4eee\u60f3\u74b0\u5883\u3092\u7528\u610f\u3057\u3066\u307f\u308b\u3010Mac\u958b\u767a\u74b0\u5883\u69cb\u7bc9\u3011&#8221; &#8212; Global Hack \u30a8\u30f3\u30b8\u30cb\u30a2\u5099\u5fd8\u9332\" src=\"https:\/\/global-hack.com\/blog\/archives\/93\/embed#?secret=So2XmSVRq7#?secret=xDuccf0G3L\" data-secret=\"xDuccf0G3L\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u4e0a\u8a18\u30ea\u30f3\u30af\u5148\u306e\u300c\u4eee\u60f3\u74b0\u5883\u3092\u8d77\u52d5\u3055\u305b\u308b\u300d\u3068\u3053\u308d\u307e\u3067\u4f5c\u696d\u304c\u9032\u3093\u3060\u3089\u3001\u3053\u3061\u3089\u3078\u623b\u3063\u3066\u5148\u3092\u9032\u3081\u307e\u3059\u3002<\/p>\n<h3>Flet\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n<p>flet_test\u3068\u3044\u3046\u540d\u524d\u306e\u4eee\u60f3\u74b0\u5883\u3067\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002\u4eee\u60f3\u74b0\u5883\u5185\u3092\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>$ source flet_test\/bin\/activate<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>(flet_test) $ pip3 install flet<\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u300cpip\u300d\u3084\u300cpip3\u300d\u3067\u300cFlet\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h3>Flet\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u308b<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3088\u304f\u3042\u308b\u300cHello, world!\u300d\u7684\u306a\u3084\u3064\u3092\u66f8\u3044\u3066main.py\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306f\u4e0b\u8a18\u753b\u50cf\u53c2\u7167\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/global-hack.com\/blog\/wp-content\/uploads\/2023\/01\/flet_test_dir.png\" alt=\"Flet\u4eee\u60f3\u74b0\u5883\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\" width=\"300\" height=\"170\" class=\"alignnone size-full wp-image-142\" \/><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import flet\r\nfrom flet import Page, Text\r\n\r\ndef main(page: Page):\r\n    page.add(Text(\"\uff08 =\uff3e\u03c9\uff3e\uff09\u306b\u3083\u3093\u306b\u3083\u3093\u304a\uff01\"))\r\n\r\nflet.app(target=main)<\/code><\/pre>\n<\/div>\n<p><img decoding=\"async\" src=\"https:\/\/global-hack.com\/blog\/wp-content\/uploads\/2023\/01\/flet_sample_code.png\" alt=\"Flet\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u3066python\u3067Flutter\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\" width=\"800\" height=\"622\" class=\"alignnone size-full wp-image-140\" \/><\/p>\n<h3>Flet\u3067\u7c21\u5358\u306a\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<p><a href=\"https:\/\/flet.dev\/docs\/\" target=\"_blank\" rel=\"nofollow noopener\" title=\"Flet\u516c\u5f0f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\">Flet\u306e\u516c\u5f0f\u30b5\u30a4\u30c8<\/a>\u3067\u30ab\u30a6\u30f3\u30bf\u30fc\u30a2\u30d7\u30ea\u304c\u30b5\u30f3\u30d7\u30eb\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u305f\u306e\u3067\u3001\u5c11\u3057\u30c7\u30b6\u30a4\u30f3\u3092\u5f04\u3063\u3066\u307f\u305f\u3002<\/p>\n<p>\u516c\u5f0f\u306e\u5b8c\u6210\u5f62\u306f\u4e0b\u8a18\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/global-hack.com\/blog\/wp-content\/uploads\/2023\/01\/flet_counter_sample.png\" alt=\"Flet\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\u30a2\u30d7\u30ea\u306e\u30b5\u30f3\u30d7\u30eb\" width=\"834\" height=\"302\" class=\"alignnone size-full wp-image-143\" \/><\/p>\n<p>\u4e0a\u8a18\u3092\u53c2\u8003\u306b\u3057\u305f\u30b3\u30fc\u30c9\u304c\u3053\u3061\u3089\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import flet as ft\r\n\r\ndef main(page: ft.Page):\r\n    app_title = \"\u30ab\u30a6\u30f3\u30bf\u30fc\u51fa\u529b\"\r\n    page.title = app_title\r\n\r\n    page.vertical_alignment = ft.MainAxisAlignment.CENTER\r\n    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER\r\n\r\n    txt_number = ft.TextField(\r\n      color=ft.colors.BLACK,\r\n      border_radius=10,\r\n      border=ft.InputBorder.NONE,\r\n      value=\"0\",\r\n      text_align=ft.TextAlign.CENTER\r\n    )\r\n\r\n    def minus_click(e):\r\n        txt_number.value = str(int(txt_number.value) - 1)\r\n        page.update()\r\n\r\n    def plus_click(e):\r\n        txt_number.value = str(int(txt_number.value) + 1)\r\n        page.update()\r\n\r\n    page.add(\r\n        ft.Column(\r\n            [\r\n                ft.Text(\r\n                    app_title\r\n                )\r\n            ]\r\n        ),\r\n        ft.Row(\r\n            [\r\n                ft.IconButton(\r\n                  ft.icons.REMOVE,\r\n                  bgcolor=ft.colors.CYAN_200,\r\n                  on_click=minus_click\r\n                  ),\r\n                ft.Container(\r\n                    content=txt_number,\r\n                    margin=10,\r\n                    padding=10,\r\n                    alignment=ft.alignment.center,\r\n                    bgcolor=ft.colors.INDIGO_50,\r\n                    border_radius=10,\r\n                    ink=True\r\n                ),\r\n                ft.IconButton(\r\n                  ft.icons.ADD,\r\n                  bgcolor=ft.colors.AMBER,\r\n                  on_click=plus_click\r\n                  ),\r\n            ],\r\n            alignment=ft.MainAxisAlignment.CENTER,\r\n        )\r\n    )\r\n\r\nft.app(target=main)<\/code><\/pre>\n<\/div>\n<p>\u8272\u30b3\u30fc\u30c9\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u4e0b\u8a18\u306e\u30a2\u30d7\u30ea\u3092\u4f7f\u308f\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/ndonkoHenri\/Flet-Color-Browser\" target=\"_blank\" rel=\"nofollow noopener\" title=\"Flet\u306e\u8272\u9078\u629e\u30a2\u30d7\u30ea\">Flet\u306e\u8272\u9078\u629e\u30a2\u30d7\u30ea<\/a><\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/global-hack.com\/blog\/wp-content\/uploads\/2023\/01\/flet_counter_test.png\" alt=\"Flet\uff08python\u7248Flutter\uff09\u3067\u4f5c\u6210\u3057\u305f\u30ab\u30a6\u30f3\u30bf\u30fc\u30a2\u30d7\u30ea \" width=\"799\" height=\"620\" class=\"alignnone size-full wp-image-145\" \/><\/p>\n<p>\u3053\u306e\u4ed6\u306b\u3082\u3044\u304f\u3064\u304b\u4f5c\u308a\u307e\u3057\u305f\u304c\u3001\u4f5c\u3063\u3066\u3044\u3066\u3068\u3066\u3082\u697d\u3057\u3044\u3068\u611f\u3058\u308b\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u304b\u3089Flet\u3067\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u3001Mac\u3092\u65b0\u8abf\u3057\u305f\u3089\u30b9\u30c8\u30a2\u306b\u516c\u958b\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Flet\u3068\u306f\u306a\u306b\u304b\uff1f Python\u3092\u4f7f\u3063\u3066Flutter\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3067\u304d\u308b\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002 Flet\u516c\u5f0f\u30b5\u30a4\u30c8 Flutter\u306f\u3001Google\u304c\u958b\u767a\u3057\u305fDart\u3068\u3044\u3046\u8a00\u8a9e\u3092\u4f7f\u3063\u3066\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3053\u306eFlutter\u306f\u3001\u69d8\u3005\u306a\u30c7\u30d0 <a class=\"mh-excerpt-more\" href=\"https:\/\/global-hack.com\/blog\/archives\/139\" title=\"\u3010Python\u3011venv\u3067Flet\u958b\u767a\u74b0\u5883\u3092\u79d2\u901f\u69cb\u7bc9\uff06\u7c21\u6613\u30a2\u30d7\u30ea\u4f5c\u6210\u3057\u3066\u307f\u305f\u3010Flutter\u3011\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":144,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,84,46],"tags":[87,86,90,88,48,89,55],"class_list":{"0":"post-139","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-flet","8":"category-flutter","9":"category-python","10":"tag-android","11":"tag-ios","12":"tag-linuxos","13":"tag-macos","14":"tag-venv","15":"tag-windowsos","16":"tag-55"},"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/global-hack.com\/blog\/wp-content\/uploads\/2023\/01\/Flutter_python_Flet.jpg","_links":{"self":[{"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":0,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/media\/144"}],"wp:attachment":[{"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/global-hack.com\/blog\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}