• Python meanderings

    From Chris Ahlstrom@21:1/5 to All on Mon Jan 13 11:27:30 2025
    XPost: comp.os.linux.misc

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rbowman@21:1/5 to Chris Ahlstrom on Mon Jan 13 19:58:38 2025
    On Mon, 13 Jan 2025 11:27:30 -0500, Chris Ahlstrom wrote:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Computer Nerd Kev@21:1/5 to Chris Ahlstrom on Tue Jan 14 07:09:14 2025
    XPost: comp.os.linux.misc

    In comp.os.linux.misc Chris Ahlstrom <OFeem1987@teleworm.us> wrote:
    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?

    --
    __ __
    #_ < |\| |< _#

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Farley Flud@21:1/5 to Chris Ahlstrom on Mon Jan 13 22:03:04 2025
    XPost: comp.os.linux.misc

    On Mon, 13 Jan 2025 11:27:30 -0500, Chris Ahlstrom wrote:


    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to Farley Flud on Mon Jan 13 23:53:18 2025
    XPost: comp.os.linux.misc

    On Mon, 13 Jan 2025 22:03:04 +0000, Farley Flud <ff@linux.rocks> wrote in <pan$de392$a8fd95f1$d57dc675$fcade1a8@linux.rocks>:

    On Mon, 13 Jan 2025 11:27:30 -0500, Chris Ahlstrom wrote:


    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."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From 186283@ud0s4.net@21:1/5 to Farley Flud on Mon Jan 13 20:55:45 2025
    XPost: comp.os.linux.misc

    On 1/13/25 5:03 PM, Farley Flud wrote:
    On Mon, 13 Jan 2025 11:27:30 -0500, Chris Ahlstrom wrote:


    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 .... :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DFS@21:1/5 to Python Larry on Mon Jan 13 22:54:33 2025
    On 1/13/2025 5:03 PM, Python Larry wrote:


    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Charles@21:1/5 to DFS on Tue Jan 14 00:01:52 2025
    On 1/13/2025 10:54 PM, DFS wrote:
    On 1/13/2025 5:03 PM, Python Larry wrote:


    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:

    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.

    "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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rbowman@21:1/5 to 186282@ud0s4.net on Tue Jan 14 04:16:49 2025
    XPost: comp.os.linux.misc

    On Mon, 13 Jan 2025 20:55:45 -0500, 186282@ud0s4.net wrote:

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Farley Flud@21:1/5 to a bunch of assholes on Tue Jan 14 10:56:09 2025
    XPost: comp.os.linux.misc

    On Tue, 14 Jan 2025 04:16:49 +0000, a bunch of assholes wrote:



    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!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to Farley Flud on Tue Jan 14 15:05:54 2025
    On 14/01/2025 10:56, Farley Flud wrote:
    On Tue, 14 Jan 2025 04:16:49 +0000, a bunch of assholes wrote:



    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





    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DFS@21:1/5 to Nick Charles on Tue Jan 14 16:33:48 2025
    On 1/14/2025 12:01 AM, Nick Charles wrote:
    On 1/13/2025 10:54 PM, DFS wrote:
    On 1/13/2025 5:03 PM, Python Larry wrote:


    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:

    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).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DFS@21:1/5 to The Natural Philosopher on Tue Jan 14 16:37:10 2025
    On 1/14/2025 10:05 AM, The Natural Philosopher wrote:


    I have sadly several programs written in python.

    Nothing sad about Python, except the performance at certain things.


    Even PERL

    OK, sad.



    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From 186283@ud0s4.net@21:1/5 to rbowman on Tue Jan 14 23:09:08 2025
    XPost: comp.os.linux.misc

    On 1/13/25 11:16 PM, rbowman wrote:
    On Mon, 13 Jan 2025 20:55:45 -0500, 186282@ud0s4.net wrote:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Charles@21:1/5 to DFS on Wed Jan 15 00:13:32 2025
    On 1/14/2025 4:33 PM, DFS wrote:
    On 1/14/2025 12:01 AM, Nick Charles wrote:
    On 1/13/2025 10:54 PM, DFS wrote:
    On 1/13/2025 5:03 PM, Python Larry wrote:


    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:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From 186283@ud0s4.net@21:1/5 to Farley Flud on Wed Jan 15 00:37:31 2025
    On 1/14/25 5:56 AM, Farley Flud wrote:
    On Tue, 14 Jan 2025 04:16:49 +0000, a bunch of assholes wrote:



    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 .....

    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.

    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 ....

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Charles@21:1/5 to Farley Flud on Wed Jan 15 00:18:08 2025
    On 1/14/2025 5:56 AM, Farley Flud wrote:
    On Tue, 14 Jan 2025 04:16:49 +0000, a bunch of assholes wrote:



    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rbowman@21:1/5 to 186282@ud0s4.net on Wed Jan 15 05:48:06 2025
    On Tue, 14 Jan 2025 23:09:08 -0500, 186282@ud0s4.net wrote:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to 186282@ud0s4.net on Wed Jan 15 06:54:59 2025
    On Wed, 15 Jan 2025 00:37:31 -0500, 186282@ud0s4.net wrote:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)