Exception Swallowing Sin
This Python Pattern Will DESTROY Your Debugging Sessions! 💀
Bare except: pass is the worst thing you can do in Python. Here's why!
🚫 What NOT to do:
• Catch all exceptions with bare except:
• Silently swallow errors with pass
✅ The right way:
• Catch specific exceptions
• Log errors properly
Silent failures are debugging nightmares!
#python #coding #programming #debugging #errorhandling #pythontutorial #learnpython
#...
https://www.youtube.com/watch?v=NmfBTsngN8c
A key idea in my book is that while change in software engineering is constant, engaging with it should be purposeful --- and may even be optional. That feels especially true with LLMs and code generation, where discussion tends to polarize quickly into advocacy or rejection.
#Python #SoftwareEngineering #TechnicalJudgment #EngineeringLeadership
Something about python makes it really easy for me to create incredibly annoying code.
This was inside of 3 nested for loops (iterating n, k, and i). Situated on the single most breakable part of the entire algorithm.
Yeahhh I'm gonna be refactoring this. Maybe I should also get some rest lol.
#python #programming #badCode #CS

Transforma tu negocio con soluciones tecnológicas innovadoras. Soy abogado y programador experto en Python y NiceGUI, listo para impulsar tu proyecto con #LegalTech. ¡Hablemos! #Python #Xiliux

I'm pretty sure lots of #Python coders already know this, but if you're annoyed with dict literals needing so many quotes, consider using dict() with keyword arguments.
{"foo": 123, "bar": 456, "baz": 789}
becomes
dict(foo=123, bar=456, baz=789)
This only works with string keys, of course, and only of every key is a valid keyword argument. For example, if one of your keys is "class", or "Bud Spencer", or even "", you can't use this method.
📝🐍 Шпаргалка по #Python Tools: основні бібліотеки та інструменти Python для аналізу даних, машинного навчання, візуалізації, роботи з базами даних, інженерії даних, обчислень і нейронних мереж

@dobbie003 @jloc0 @thesaigoneer
https://www.youtube.com/watch?v=UccHgrPkg50
My workflow with #Slackware #music #mpd #quickshell (for the cental mixer gui) and #python #pyqt6 for the tray icon and volume slider.
Odoo does that kind of nasty things too and so does Ansible, IIRC. So dynamic import by tampering `sys.path` seems pretty common. I'm surprised there's no easy way to tell PyCharm "you will find code for this module in this directory, please resolve correctly".
I think I remember a mecanism that allowed to install a module in `site-package` with pip without a pyproject.toml or setup.cfg by symlinking it. I found something with `.pth` but I couldn't get something to work. Of course just renaming `modules` to `woob_modules` and mark it as code it out of question. Any idea?
The solution I found so far is to symlink `modules` to `woob_modules`. This mostly works, Pycharm shows no import error but then, when I want to navigate to source with Ctrl+B PyCharm navigates to a directory under the symlink instead of the actual file. PyCharm seems to consider `modules` and `woob_modules` are two different directory which causes problems with breakpoints and code desync between the 2 versions of the file. I need to constantly refresh from filesystem.
Hey #Python community, I'm struggling with #PyCharm a bit. I'm in a situation of contributing to a project that dynamically detects and adds Python modules from non-standard location (probably by tampering `sys.path`). Namely woob. During development, those packages are located in a directory (not a module, there's no `__init__.py`) named `modules`. But they are imported as `woob_modules` in code.
So when companies try to monetize everything...
I have an electric car and a charger at home, also a distributor to prevent over current. Due to high prices during daytime I have the possibility in the distributor to set a schedule when my charge box should be available.
So far so good, but ...
I can only set different time schedules and not days, so weekends I'm stuck with my week schedule, even though the price is lower and I could charge my car 24h.
I sen't a mail to the support and asked for that config option, and yes you guessed it right.
-Sure, that is possible with our PRO subscription.
Thank you and f**k off.
I'm no developer but with Burp Suite, Python and some cups of coffee I now have written an API parser in python that will accept command line args.
myprog.py --disable / enable
now I can schedule with crontab my own without your PRO subscription.
HA!
#python #API #electriccar #charging