serhii.net

In the middle of the desert you can say anything you want

01 Apr 2026

NiceGUI notes

NiceGUI is freaking awesome.

Misc

Snippets

Uploading files

ui.upload | NiceGUI

ui.upload(
	auto_upload=True, on_upload=lambda e: handle_upload(e)
).classes("max-w-full")

async def handle_upload(e: events.UploadEventArguments):
	with tempfile.NamedTemporaryFile(delete=False, prefix="uns") as tmp:
        save_path = Path(tmp.name)
        await e.file.save(save_path)
        return save_path
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus