亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
What is Flet
Key Features
Go from idea to application in minutes
Simple Architecture
Battery included
Powered by Flutter
Language agnostic
Delivery to any device
Installation and use
A simple counting example
Summary
Home Backend Development Python Tutorial Flet: a cross-platform Flutter-based Python framework

Flet: a cross-platform Flutter-based Python framework

Apr 20, 2023 pm 05:46 PM
Front-end development flet

Flet: a cross-platform Flutter-based Python framework

I just posted a micro-headline about the complete collection of Python desktop development libraries yesterday, and my colleague discovered the Flet library. This is a very new library. The first version was only released in June this year. Although it is very new, it is backed by the giant Flutter and allows us to use Python to develop full-platform software. Although it does not currently support all platforms, According to the author’s plan, whatever Flutter supports, it will support in the future. I briefly studied it yesterday and it’s really great. I recommend it to everyone. We can use it to do a series of things later.

What is Flet

Flet is a framework that allows building interactive multi-user web, desktop and mobile applications in your favorite language without having to have experience with front-end development.

Key Features

Go from idea to application in minutes

Apps for your team, weekend projects, data entry forms, kiosk applications or high-fidelity prototypes of in-house tools or dashboards - Flet is an ideal framework for quickly hacking together a beautiful, interactive application that serves a group of users.

Simple Architecture

No more complex architecture with JavaScript frontend, REST API backend, database, cache, etc. With Flet, you can get a multi-user real-time single-page application (SPA) simply by writing a monolithic stateful application in Python.

Battery included

To start developing with Flet, all you need is your favorite IDE or text editor. No SDK, no thousands of dependencies, no complex tools - Flet has a built-in web server that includes managed assets and a desktop client.

Powered by Flutter

Flet UI is built with Flutter so your app looks professional and ready to be delivered to any platform. Flet simplifies the Flutter model by combining smaller "widgets" into ready-to-use "controls" with an imperative programming model.

Language agnostic

Flet is language agnostic, so anyone on your team can develop Flet applications in their favorite language. Python is already supported, with Go, C# and other products not far behind .

Delivery to any device

Deploy your Flet app as a web app and view it in a browser. Package it as a standalone desktop application for Windows, macOS, and Linux. Install it as a PWA on your mobile device or view it via the Flet app for iOS and Android.

Installation and use

pip install flet

A simple counting example

import flet
from flet import IconButton, Page, Row, TextField, icons
def main(page: Page):
page.title = "Flet counter example"
page.vertical_alignment = "center"

txt_number = TextField(value="0", text_align="right", width=100)

def minus_click(e):
txt_number.value = int(txt_number.value) - 1
page.update()

def plus_click(e):
txt_number.value = int(txt_number.value) + 1
page.update()

page.add(
Row(
[
IconButton(icons.REMOVE, on_click=minus_click),
txt_number,
IconButton(icons.ADD, on_click=plus_click),
],
alignment="center",
)
)

flet.app(target=main)

Run the program:

python counter.py

Flet: a cross-platform Flutter-based Python framework

How We want it to run only on the browser side, which can be configured as follows:

flet.app(target=main, view=flet.WEB_BROWSER)

The default is to run the desktop side, but when we start it, a web server will be started on a random port, which can also be accessed on the web side.

Flet: a cross-platform Flutter-based Python framework

This is a simple example given by the official. Let’s write a slightly more complicated one: a calculator.

Flet: a cross-platform Flutter-based Python framework

The page has a lot of code, but it is quite simple, so I won’t post it. You can see that even if you use native controls to spell out the page, the effect is pretty good, which is better than other Python Desktop development libraries are much nicer to look at. Although it does not have an interface designer like QT, which can generate pages by dragging and dropping, its layout method is the same as that of the front-end, so it is very familiar to developers who know the front-end and is very convenient to use.

Summary

At present, this project is only a BETA version, and the official documentation is not complete enough, but it is still no problem for developing some basic software. Especially based on Flutter, there is no need to package the chromium core like Electron. After accessing multiple languages ??later, it will provide many programmers with an excellent cross-platform development method. They do not need a specific development language to get started like Electron and Flutter. We look forward to it becoming more complete. Later we can try some more gadgets to practice our skills.

The above is the detailed content of Flet: a cross-platform Flutter-based Python framework. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
How to use PHP and Angular for front-end development How to use PHP and Angular for front-end development May 11, 2023 pm 04:04 PM

With the rapid development of the Internet, front-end development technology is also constantly improving and iterating. PHP and Angular are two technologies widely used in front-end development. PHP is a server-side scripting language that can handle tasks such as processing forms, generating dynamic pages, and managing access permissions. Angular is a JavaScript framework that can be used to develop single-page applications and build componentized web applications. This article will introduce how to use PHP and Angular for front-end development, and how to combine them

The key optimization mode to improve website speed, every front-end developer must master! The key optimization mode to improve website speed, every front-end developer must master! Feb 02, 2024 pm 05:36 PM

A must-have for front-end developers: master these optimization modes and make your website fly! With the rapid development of the Internet, websites have become one of the important channels for corporate promotion and communication. A well-performing, fast-loading website not only improves user experience, but also attracts more visitors. As a front-end developer, it is essential to master some optimization patterns. This article will introduce some commonly used front-end optimization techniques to help developers better optimize their websites. Compressed files In website development, commonly used file types include HTML, CSS and J

Is Django suitable for front-end or back-end development? Is Django suitable for front-end or back-end development? Jan 19, 2024 am 09:50 AM

Django is a web application framework built in Python that helps developers quickly build high-quality web applications. The development process of Django usually involves two aspects: front-end and back-end, but which aspect of development is Django more suitable for? This article will explore the advantages of Django in front-end and back-end development and provide specific code examples. Advantages of Django in back-end development Django, as a back-end framework, has many advantages, as follows:

Learn to use sessionstorage to improve front-end development efficiency Learn to use sessionstorage to improve front-end development efficiency Jan 13, 2024 am 11:56 AM

To master the role of sessionStorage and improve front-end development efficiency, specific code examples are required. With the rapid development of the Internet, the field of front-end development is also changing with each passing day. When doing front-end development, we often need to process large amounts of data and store it in the browser for subsequent use. SessionStorage is a very important front-end development tool that can provide us with temporary local storage solutions and improve development efficiency. This article will introduce the role of sessionStorage,

New trends in Golang front-end: Interpretation of Golang's application prospects in front-end development New trends in Golang front-end: Interpretation of Golang's application prospects in front-end development Mar 20, 2024 am 09:45 AM

New trends in Golang front-end: Interpretation of the application prospects of Golang in front-end development. In recent years, the field of front-end development has developed rapidly, and various new technologies have emerged in an endless stream. As a fast and reliable programming language, Golang has also begun to emerge in front-end development. Golang (also known as Go) is a programming language developed by Google. It is famous for its efficient performance, concise syntax and powerful functions, and is gradually favored by front-end developers. This article will explore the application of Golang in front-end development.

The Evolution of JavaScript: Current Trends and Future Prospects The Evolution of JavaScript: Current Trends and Future Prospects Apr 10, 2025 am 09:33 AM

The latest trends in JavaScript include the rise of TypeScript, the popularity of modern frameworks and libraries, and the application of WebAssembly. Future prospects cover more powerful type systems, the development of server-side JavaScript, the expansion of artificial intelligence and machine learning, and the potential of IoT and edge computing.

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

Summary of experience in JavaScript asynchronous requests and data processing in front-end development Summary of experience in JavaScript asynchronous requests and data processing in front-end development Nov 03, 2023 pm 01:16 PM

Summary of experience in JavaScript asynchronous requests and data processing in front-end development In front-end development, JavaScript is a very important language. It can not only achieve interactive and dynamic effects on the page, but also obtain and process data through asynchronous requests. In this article, I will summarize some experiences and tips when dealing with asynchronous requests and data. 1. Use the XMLHttpRequest object to make asynchronous requests. The XMLHttpRequest object is used by JavaScript to send

See all articles