Saturday, August 12, 2023

Follow me on mastodon

Follow me on mastodon 

FLET: A python GUI based on Flutter

I am always on the lookout for new (easier) ways to create GUIs for python. Recently I ran across the FLET. Also available on github.

Their description is

The fastest way to build Flutter apps in Python

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.

As an experiment I decided to create a simple login form.

import flet as ft

def main(page: ft.Page):
page.title = "Login"
page.window_height = 200
page.window_width = 500
page.window_always_on_top = True

def cancel_click(e):
page.window_destroy()

def login_click(e):
if txt_user.value == "admin" and txt_pwd.value == "admin":
dlg.content = ft.Text("Login Successful")
else:
dlg.content = ft.Text("Login failed")
dlg.modal = False
dlg.open = True
dlg.update()
page.update()

dlg = ft.AlertDialog(title=ft.Text("Login"), content=ft.Text("---"))
txt_user = ft.TextField(value = "", label="User ID")
txt_pwd = ft.TextField(value = "", password=True, can_reveal_password=True,
label="Password")
btn_cancel = ft.FilledButton(text="Cancel", on_click=cancel_click)
btn_login = ft.FilledButton(text="Login", on_click=login_click)
action_row = ft.Row(controls=[btn_cancel, btn_login])
page.add(txt_user, txt_pwd, action_row, dlg)
page.window_center()

ft.app(target=main)

  This results in the following window


A jupyter notebook is here.


Monday, October 1, 2018

Friday, September 21, 2018

Abseil - an open-source collection of C++ library code designed to augment the C++ standard library

Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google’s own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.