Weil ich gerade drüber gestolpert bin:
GUIZero
https://lawsie.github.io/guizero/
Damit kann man mit ein paar Zeilen Python-Code einfache GUIs erstellen.
Weil ich gerade drüber gestolpert bin:
GUIZero
https://lawsie.github.io/guizero/
Damit kann man mit ein paar Zeilen Python-Code einfache GUIs erstellen.
Das ist nett, aber an einer entscheidenden Stelle gibt es bei mir Probleme.
Works with standard Python Tkinter GUI library (and no need to install other libraries).
Python muss bei mir scheinbar extra für Tk konfiguriert werden, sonst steht es auf dem Schlauch.
$ python3
Python 3.12.9 (main, Feb 4 2025, 14:38:38) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'
Schaut gerne mal zu Toga.
Toga is a Python native, OS native, cross platform GUI toolkit. Toga consists of a library of base components with a shared interface to simplify platform-agnostic GUI development.
Toga is available on macOS, Windows, Linux (GTK), Android, iOS, for single-page web apps, and console apps.
pip install --user uv
uv pip install toga-demo
toga-demo
Stimmt, so klappt es gut. Bedankt!
brew install python-tk
==> Downloading https://ghcr.io/v2/homebrew/core/python-tk/3.13/manifests/3.13.2
######################################################################################################################################################### 100.0%
==> Fetching dependencies for python-tk@3.13: libtommath and tcl-tk
==> Downloading https://ghcr.io/v2/homebrew/core/libtommath/manifests/1.3.0
Already downloaded: /Users/amo/Library/Caches/Homebrew/downloads/ef0348de57a0a05db93896c0262f3ca870cb09716b9ece7572affab5e7e52423--libtommath-1.3.0.bottle_manifest.json
==> Fetching libtommath
==> Downloading https://ghcr.io/v2/homebrew/core/libtommath/blobs/sha256:b0e54d27c97e9bad7b9377cb2ba3621c59c5ecd2e231d71b2181316febb008b5
######################################################################################################################################################### 100.0%
==> Verifying attestation for libtommath
==> Downloading https://ghcr.io/v2/homebrew/core/tcl-tk/manifests/9.0.1-1
######################################################################################################################################################### 100.0%
==> Fetching tcl-tk
==> Downloading https://ghcr.io/v2/homebrew/core/tcl-tk/blobs/sha256:9a562a67f6b533ad35b267cc22b8299ecd869ab1089a2cd19d410e36f30a6c1f
######################################################################################################################################################### 100.0%
==> Verifying attestation for tcl-tk
==> Fetching python-tk@3.13
==> Downloading https://ghcr.io/v2/homebrew/core/python-tk/3.13/blobs/sha256:723819cff02361a76aa58cb6dfd77008b2a8c01b118d329fb5ca959135ee95bf
######################################################################################################################################################### 100.0%
==> Verifying attestation for python-tk@3.13
==> Installing dependencies for python-tk@3.13: libtommath and tcl-tk
==> Installing python-tk@3.13 dependency: libtommath
==> Downloading https://ghcr.io/v2/homebrew/core/libtommath/manifests/1.3.0
Already downloaded: /Users/amo/Library/Caches/Homebrew/downloads/ef0348de57a0a05db93896c0262f3ca870cb09716b9ece7572affab5e7e52423--libtommath-1.3.0.bottle_manifest.json
==> Pouring libtommath--1.3.0.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/libtommath/1.3.0: 12 files, 482KB
==> Installing python-tk@3.13 dependency: tcl-tk
==> Downloading https://ghcr.io/v2/homebrew/core/tcl-tk/manifests/9.0.1-1
Already downloaded: /Users/amo/Library/Caches/Homebrew/downloads/be646597f3d79273593a6a054e9ad1fcc722de45fe4be5464b2a5275f8b7303b--tcl-tk-9.0.1-1.bottle_manifest.json
==> Pouring tcl-tk--9.0.1.ventura.bottle.1.tar.gz
🍺 /usr/local/Cellar/tcl-tk/9.0.1: 3,150 files, 37.6MB
==> Installing python-tk@3.13
==> Pouring python-tk@3.13--3.13.2.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/python-tk@3.13/3.13.2: 6 files, 143.8KB
==> Running `brew cleanup python-tk@3.13`...
>>> import tkinter
>>> tkinter.YES
1