Discussion:
Python meanderings
Add Reply
Chris Ahlstrom
2025-01-13 16:27:30 UTC
Reply
Permalink
I had a list of 120 items I wanted to construct for a configuration file. After
editing 20 of them I thought, this is nuts, it'll take me forever. So I decided
to write a simple python script. I took a look at a Python program I wrote many
years ago, but it was much more complex than I remebers, with making
directories, handling a fair number of command-line options, file-tree walking.
Too much, so I made a small script to do the job and it was pretty easy.

Now I want to run an audio/MIDI session manager. The JACK project ported the
Non Session Manager as the "New Session Manager", and includes the original
GUI. But I wanted something a little more modern.

Downloaded, built, and installed the Python app "agordejo". It does not run on
this Debian system. "This application failed to start because no Qt platform
plugin could be initialized." Haven't figured that out.

So there's another Python-based session manager, RaySession, which is part of
the Debian repo. I install that and run it, and I get a traceback about 15
levels deep. "No module named cgitb".

https://docs.python.org/3/library/cgitb.html

This module is no longer part of the Python standard library. It was
removed in Python 3.13 after being deprecated in Python 3.11. The removal
was decided in PEP 594.

A fork of the module on PyPI can now be used instead: legacy-cgi. This is a
copy of the cgi module, no longer maintained or supported by the core
Python team.

The last version of Python that provided the cgitb module was Python 3.12.

Installing legacy-cgi from the link didn't work (wants a virtual setup).
But python3-legacy-cgi in the repo works, and I can now run RaySession.
--
Q: How do you stop an elephant from charging?
A: Take away his credit cards.
rbowman
2025-01-13 19:58:38 UTC
Reply
Permalink
Post by Chris Ahlstrom
So there's another Python-based session manager, RaySession, which is
part of the Debian repo. I install that and run it, and I get a
traceback about 15 levels deep. "No module named cgitb".
I hit that with CherryPy after updating Python. CherryPy is an older web
framework and may not have caught up. Many of the developers are Ukrainian
and may have other things on their minds.

I use venvs so the legacy package wasn't a problem.
Computer Nerd Kev
2025-01-13 21:09:14 UTC
Reply
Permalink
Post by Chris Ahlstrom
Downloaded, built, and installed the Python app "agordejo". It does not run on
this Debian system. "This application failed to start because no Qt platform
plugin could be initialized." Haven't figured that out.
So there's another Python-based session manager, RaySession, which is part of
the Debian repo. I install that and run it, and I get a traceback about 15
levels deep. "No module named cgitb".
https://docs.python.org/3/library/cgitb.html
This module is no longer part of the Python standard library. It was
removed in Python 3.13 after being deprecated in Python 3.11. The removal
was decided in PEP 594.
A fork of the module on PyPI can now be used instead: legacy-cgi. This is a
copy of the cgi module, no longer maintained or supported by the core
Python team.
The last version of Python that provided the cgitb module was Python 3.12.
Installing legacy-cgi from the link didn't work (wants a virtual setup).
But python3-legacy-cgi in the repo works, and I can now run RaySession.
If I'm looking for a program and find a Python script that does
exactly what I want, I keep looking. Too much time wasted trying to
make them run for me, or wasted later when they break compatibility
in a newer Python release.

But I have assumed that Python scripts with Debian (stable)
packages are safe because it's someone else's problem to deal with
making them run with the Python that's pacakged there. But you say
that RaySession came from "the Debian repo" so I guess that
package's maintainer couldn't even get it right. Maybe I should be
even more strict with exterminating these pesky snakes?
--
__ __
#_ < |\| |< _#
Farley Flud
2025-01-13 22:03:04 UTC
Reply
Permalink
Post by Chris Ahlstrom
Downloaded, built, and installed the Python app "agordejo". It does not run on
this Debian system. "This application failed to start because no Qt platform
plugin could be initialized." Haven't figured that out.
You are a brave person indeed.

Whenever I encounter a project that requires Python I run away
like mad.

It could be that any developer who chooses Python is totally
incompetent.

It could be something else.

But whatever, it is no Python for me ever.
--
Systemd: solving all the problems that you never knew you had.
vallor
2025-01-13 23:53:18 UTC
Reply
Permalink
Post by Farley Flud
Post by Chris Ahlstrom
Downloaded, built, and installed the Python app "agordejo". It does not
run on this Debian system. "This application failed to start because no
Qt platform plugin could be initialized." Haven't figured that out.
You are a brave person indeed.
Whenever I encounter a project that requires Python I run away like mad.
It could be that any developer who chooses Python is totally
incompetent.
It could be something else.
But whatever, it is no Python for me ever.
How can you tell when Feeb is wrong? Whenever
he writes.

(His distro's package manager uses Python.)
--
-v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
OS: Linux 6.13.0-rc7 Release: Mint 21.3 Mem: 258G
"I used to have a handle on life, then it broke."
186282@ud0s4.net
2025-01-14 01:55:45 UTC
Reply
Permalink
Post by Farley Flud
Post by Chris Ahlstrom
Downloaded, built, and installed the Python app "agordejo". It does not run on
this Debian system. "This application failed to start because no Qt platform
plugin could be initialized." Haven't figured that out.
You are a brave person indeed.
Whenever I encounter a project that requires Python I run away
like mad.
It could be that any developer who chooses Python is totally
incompetent.
It could be something else.
But whatever, it is no Python for me ever.
Python is perfectly good, so WHERE could the
problem be .... :-)
rbowman
2025-01-14 04:16:49 UTC
Reply
Permalink
Python is perfectly good, so WHERE could the problem be ....
A world renown C programmer would never stoop to something as plebeian as
Python. Why do something adequate for the task in 50 lines when you can do
it in 500?
Farley Flud
2025-01-14 10:56:09 UTC
Reply
Permalink
Python is perfectly good, so WHERE could the problem be ....
[snip remainder of collective idiocy]
I do beg your fucking pardons. I should have said that I will run like
hell from Python GUI projects. Repeat: I will run like hell from Python
GUI projects.

But I assumed that it would be undestood from the context of the OP.

However, the proper understanding of context requires a modicum of
intelligence which you all fucking buzzards do not possess.
--
Hail Linux! Hail FOSS! Hail Stallman!
The Natural Philosopher
2025-01-14 15:05:54 UTC
Reply
Permalink
Post by Farley Flud
Python is perfectly good, so WHERE could the problem be ....
[snip remainder of collective idiocy]
I do beg your fucking pardons. I should have said that I will run like
hell from Python GUI projects. Repeat: I will run like hell from Python
GUI projects.
I have sadly several programs written in python. Even PERL

They are all memory hogs and slow.

But they normally work ok
Post by Farley Flud
But I assumed that it would be undestood from the context of the OP.
However, the proper understanding of context requires a modicum of
intelligence which you all fucking buzzards do not possess.
--
Gun Control: The law that ensures that only criminals have guns.
DFS
2025-01-14 21:37:10 UTC
Reply
Permalink
Post by The Natural Philosopher
I have sadly several programs written in python.
Nothing sad about Python, except the performance at certain things.
Post by The Natural Philosopher
Even PERL
OK, sad.
Post by The Natural Philosopher
They are all memory hogs and slow.
But they normally work ok
My large-ish PyQt GUI project is fast once it gets going, but it's slow
to load the first time. It uses 44MB of memory at first, then builds up
to around 55.

Excel 2003 uses 3MB of RAM on start.

Betterbird newsreader uses 227MB

Brave browser with YouTube page open but no videos playing uses 600MB.
unknown
2025-01-15 05:18:08 UTC
Reply
Permalink
Post by Farley Flud
Python is perfectly good, so WHERE could the problem be ....
[snip remainder of collective idiocy]
I do beg your fucking pardons. I should have said that I will run like
hell from Python GUI projects. Repeat: I will run like hell from Python
GUI projects.
That clanking sound you hear is Feeb, furiously backpedaling.

What a twat. Caught AGAIN making a total fool of himself.
186282@ud0s4.net
2025-01-15 05:37:31 UTC
Reply
Permalink
Post by Farley Flud
Python is perfectly good, so WHERE could the problem be ....
[snip remainder of collective idiocy]
I do beg your fucking pardons. I should have said that I will run like
hell from Python GUI projects. Repeat: I will run like hell from Python
GUI projects.
Python isn't so great for GUIs. I've done a few,
but it's always a fight.

Frankly all of the 'graphic toolkits' are a pain
in the ass regardless of what lang they're meant
for. Memory-mapped screens from the DOS days were
easy, but now .....
Post by Farley Flud
But I assumed that it would be undestood from the context of the OP.
Nope. Not at all. Looked like a global indictment
of Python in any context.
Post by Farley Flud
However, the proper understanding of context requires a modicum of
intelligence which you all fucking buzzards do not possess.
Proper intelligence means not ASSUMING too much :-)

Now Flud Off ....
Lawrence D'Oliveiro
2025-01-15 06:54:59 UTC
Reply
Permalink
Post by ***@ud0s4.net
Python isn't so great for GUIs.
What makes it better is async/await. If you wrap the GUI toolkit event
loop in an asyncio-compatible wrapper, then that lets you write event-
loop-agnostic async code!

Examples of using my GLib/GTK wrapper:
<https://bitbucket.org/ldo17/glibcoro_examples/>.

Not sure this is possible in any other language.

186282@ud0s4.net
2025-01-15 04:09:08 UTC
Reply
Permalink
Post by rbowman
Python is perfectly good, so WHERE could the problem be ....
A world renown C programmer would never stoop to something as plebeian as
Python. Why do something adequate for the task in 50 lines when you can do
it in 500?
Depends - do you get paid by the hour ? :-)

In any case, Python isn't THAT much more verbose, and
it's easier to understand. Yer 'C' code may be smaller,
but ideally there's a LOT of comment lines .... even
you won't understand half of it in a year or two.

But, as said, I often split the diff and program
in Pascal.
rbowman
2025-01-15 05:48:06 UTC
Reply
Permalink
But, as said, I often split the diff and program in Pascal.
My memory of Pascal is TurboPascal on a CP/M box. $50 and it certainly
compiled a lot faster than BDS C. It was interesting but Wirth and I
don't agree on what code should look like.
DFS
2025-01-14 03:54:33 UTC
Reply
Permalink
Post by Farley Flud
no Python for me ever.
Python (via Portage) is the "heart of Gentoo", and it holds your hand
and administers your GuhNoo shitbox for you. And you suck it up like
there's no tomorrow:


"Today, the best GNU/Linux distro, Gentoo, automagically downloaded,
configured, and compiled from the source code, according to my strict
specifications..."


Feeb : It's magic Momma!

Momma: No son, it's Python.
unknown
2025-01-14 05:01:52 UTC
Reply
Permalink
Post by DFS
Post by Farley Flud
no Python for me ever.
Python (via Portage) is the "heart of Gentoo", and it holds your hand
and administers your GuhNoo shitbox for you.  And you suck it up like
Except his shit is not even IN a box. It is all sitting on a piece of
wood with a huge fan. Everything is exposed like some 1980's high
school science project.

Spectacularly inept.
Post by DFS
"Today, the best GNU/Linux distro, Gentoo, automagically downloaded,
configured, and compiled from the source code, according to my strict
specifications..."
Feeb : It's magic Momma!
Momma: No son, it's Python.
Classic. Feeb indeed.
DFS
2025-01-14 21:33:48 UTC
Reply
Permalink
Post by DFS
Post by Farley Flud
no Python for me ever.
Python (via Portage) is the "heart of Gentoo", and it holds your hand
and administers your GuhNoo shitbox for you.  And you suck it up like
Except his shit is not even IN a box.   It is all sitting on a piece of
wood with a huge fan.  Everything is exposed like some 1980's high
school science project.
Spectacularly inept.
Apparently the clown doesn't understand his computers would be cooler
inside a case (with fans of course).
unknown
2025-01-15 05:13:32 UTC
Reply
Permalink
Post by DFS
Post by DFS
Post by Farley Flud
no Python for me ever.
Python (via Portage) is the "heart of Gentoo", and it holds your hand
and administers your GuhNoo shitbox for you.  And you suck it up like
Except his shit is not even IN a box.   It is all sitting on a piece
of wood with a huge fan.  Everything is exposed like some 1980's high
school science project.
Spectacularly inept.
Apparently the clown doesn't understand his computers would be cooler
inside a case (with fans of course).
Apparently the clown does not understand anything about computers.
Hardware OR software.
Loading...