mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,5 Tsd.
aktive Profile

#tkinter

1 Beitrag1 Beteiligte*r0 Beiträge heute
Alexandre B A Villares 🐍<p><span class="h-card" translate="no"><a href="https://oldbytes.space/@feoh" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>feoh</span></a></span> <span class="h-card" translate="no"><a href="https://infosec.exchange/@paco" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>paco</span></a></span> <a href="https://ciberlandia.pt/tags/uv" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>uv</span></a> <a href="https://ciberlandia.pt/tags/tkinter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tkinter</span></a> I have <del>yet to test</del> <em>tested</em> this, <del>but</del> it looks like <span class="h-card" translate="no"><a href="https://mastodon.social/@geofft" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>geofft</span></a></span> is one of those heroes without a cape!</p><p><a href="https://github.com/astral-sh/python-build-standalone/pull/676" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/astral-sh/python-bu</span><span class="invisible">ild-standalone/pull/676</span></a></p>
Alexandre B A Villares 🐍<p>I'm hoping <span class="h-card" translate="no"><a href="https://mastodon.social/@geofft" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>geofft</span></a></span> can fix this 2022 issue on <a href="https://ciberlandia.pt/tags/uv" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>uv</span></a> built <a href="https://ciberlandia.pt/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> binaries that breaks <a href="https://ciberlandia.pt/tags/tkinter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tkinter</span></a>, wishing him best of luck!</p><p><a href="https://github.com/astral-sh/python-build-standalone/issues/129#issuecomment-3016695658" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/astral-sh/python-bu</span><span class="invisible">ild-standalone/issues/129#issuecomment-3016695658</span></a></p>

So... I wanted to package my Python app using tkinter UI library (it is just good enough for my purpose) as a flatpak. Flatpaks are based on "runtimes" similar to docker base images.

As I did obviously not use any "big" UI framework (Gnome or KDE) and it already provides Python with tkinter, I decided to use the org.freedesktop.Platform as a runtime for my flatpak. The first challenge was to get the dbus-python package to compile, as it requires a dbus binary for compiling it. So I added the freedesktop DBus implementation. I need dbus functionallity, as it allows me to use the "XDG Desktop Portals" to interactively open files when running in the flatpak sandbox. After this, everything worked! :neocat_happy:

Unfortunately, the application cannot load any proper font, so it falls back to the 90s era fonts compiled statically into Tcl/Tk (which tkinter is based on). After some trial and error, and finding out how add custom fonts to Tk, I disovered that the freedesktop runtime does not ship freedesktop fontconfig. And also I can't add it that easily to the build step, too, as the bundled Tk installation does not link to it anyway… :neocat_angry:

#flatpak#freedesktop#tkinter

Burned at least an hour I didn't have trying to get tkinter to run inside PyCharm.

What eventually worked: uninstall the flatpak version of PyCharm that Ubuntu's default "software" app offers and get one directly from JetBrains.

Once again, all computer problems are solved with some variant of "turn it off and back on again".

#python#tkinter#pycharm

From the archive! Creating A Word Clock With Python And Tkinter

The clock was essentially a wall of letters with lights behind that light up depending on what time it is as a sentence.

Without the lights the clock looks like a jumble of letters, it is only when the relevant letters are "lit" from behind is on that the relevant time is displayed.

hashbangcode.com/article/creat

#python#tkinter#hashbangcode