Posts

Showing posts from December, 2025

No Rhyme, No Reason, Just Trial, Error and Luck

Image
Every so often my Python code doesn't work even though it "should". I'm relying on somebody's imported module and have no idea how it works. In this case it is the PYTTSX3 module. In theory, if you follow the instructions, it will accept a text string and output the corresponding audio in a male voice or a female voice. (TTS means Text To Speech). I got it to work. But only ONCE. When called the second time ... silence. Apparently I'm not the first to experience this puzzling behavior. Look it up in Reddit, look it up in Google and you see that others also ask, "How do I get  PYTTSX3 to play more than once?" Google's AI (Gemini) offers some suggestions but none of them work. Out of frustration, I try all kinds of permutations including re-initializing the talk engine, time delays, whatever. Out of dumb luck I stumble upon a variation that suddenly makes my old Windows 10 computer perform. Why does this variation work? No idea. ( Click on ...

Complacency Leads to Imported Modules Mix-up

Image
I had another import crash problem. This one wasn't as bad as my earlier plunge into circular import hell . Nonetheless, it took almost a week to figure out what had gone wrong. And until I finally had the answer in hand, I didn't know if this was going to be a time-consuming super hard problem or just a trivial annoyance . It turned out to be somewhere in between. Hindsight is of course, 20/20. So here below is the answer in visual form: Shown side by side are two folders, each featuring a .venv directory containing a "Package_03" of many of my self-built modules including a vars_01, funcs_01 and funcs_02 module ( click to enlarge ) It seems that my IDE (PyCharm) cobbled together a project definition (on it own? or my fault?) that mixed together modules from both directories. That caused it to report inabilities to import from one or the other of the same-named, Package_03's. I changed the names of all the files in one of these two .venv folders...