python

Back Open Paginator
07.12.2025 19:51
danielmclaury (@danielmclaury@mathstodon.xyz)

One of the most annoying problems I routinely encounter:

I want to write a simple command-line utility that takes some arguments and generates some output file(s) based on templates. And I want to distribute this to other people.

Of course the natural way to do this would be to have a single script file containing the code, and a few template files that it uses.

But then how to distribute this? You want the script somewhere in your path, but you probably don't want template files in /usr/local/bin or wherever. So now I have to have some way of telling the script where to find the templates. And also a way of giving this to a user in a way that makes it easy to deploy all the files in all the places.

So, instead, I usually end up embedding the templates as strings in the script itself, which in (depending on exactly how I do it) means escaping a bunch of stuff.

I think what I'd like is some kind of compiler that packages a (say) #python script and several resource files into a single distributable .py file in such a way that I can write code that can either read these files in the unpackaged (for development/testing) or packaged (for distribution) state.

The alternative seems to be adding a whole extra process where I make everything into a .dpkg file for distribution, which seems like pretty massive overkill.




Show Original Post


07.12.2025 19:36
AndriiKuznietsov75 (@AndriiKuznietsov75@social.kyiv.dcomm.net.ua)

👨‍💻🐍 30-Days-Of-Python - структурований курс для вивчення #Python за 30 днів. Містить практичні завдання, приклади коду та детальні пояснення для поступового освоєння мови програмування.

🔗 github.com/Asabeneh/30-Days-Of




Show Original Post


07.12.2025 19:02
PythonPeak (@PythonPeak@mastodon.social)

Generator Misuse

Converting Generator to List Then Back to Generator?! Python Waste! 🔄

Why use generators efficiently when you can convert them unnecessarily? This defeats the purpose!

🚫 What NOT to do:
• Convert generators to lists unnecessarily
• Lose generator benefits
• Waste memory

✅ The right way: Use generators directly when possible

Generators save memory! This Code Crimes shows why generator misuse is wasteful.

...

youtube.com/watch?v=lPgZfKxWaqo




Show Original Post


07.12.2025 18:54
darbales (@darbales@rollenspiel.social)

Habe ein Archivmend bekommen #alttext4me
#python





Show Original Post


07.12.2025 18:32
habr (@habr@zhub.link)

Иллюзия 95%: гайд по самой частой элементарной ошибке в Data Science

Что, если я скажу тебе, что у параметра нет вероятности? Это самая распространенная и устойчивая когнитивная ошибка в Data Science. Она встречается в курсовых, в учебниках и даже в документациях библиотек. Здесь мы напишем симуляцию на Python, увидим, как «прыгают» интервалы, поймем, как тут могут помочь пластмассовые игрушки советских детей, и узнаем, как же тогда математически точно отвечать менеджерам на их вопросы, чтобы они навсегда перестали с вами разговаривать. Добро пожаловать в кроличью нору частотной статистики.

habr.com/ru/articles/974186/

#статистика #доверительный_интервал #математическая_статистика #анализ_данных #теория_вероятностей #python #визуализация_данных #ab_тестирование #ошибки_мышления #статистическая_значимость




Show Original Post


07.12.2025 18:30
15r10nk (@15r10nk@fosstodon.org)

I'm making good progress with the new customization feature for inline snapshots... but I've encountered some issues when trying to use it with dirty-equals.

What do you think of it so far?

#python #pytest





Show Original Post


07.12.2025 18:20
david_alberto (@david_alberto@social.sciences.re)

Still exploring OpenStreetMap data with this map of sundials in Europe.
#openstreetmap

There are in fact many more sundials. If you know one around you, please mark it on on openstreetmap.org/

Well... is it a map of sundials or a map of OSM contributors?🤔 Anyway, congratulations to northern Italy!

#astronomy #maps
#Python script available on my blog.





Show Original Post


07.12.2025 18:20
askubuntu (@askubuntu@ubuntu.social)

python: "AttributeError: module 'ssl' has no attribute 'wrap_socket'" when calling mysql.connector.connect() #python #mysql #ssl

askubuntu.com/q/1560591/612




Show Original Post


07.12.2025 18:00
lobsters (@lobsters@mastodon.social)

KOllector - Publishing KOReader Highlights lobste.rs/s/q8znua
tech.stonecharioteer.com/posts




Show Original Post


07.12.2025 17:34
Orinks (@Orinks@mastodon.stickbear.me)

Solid testing like it's 1999...
===== 1999 passed, 1 skipped, 42
deselected, 1 warning in 73.31s (0:01:13) ===== #Python #pytest




Show Original Post


07.12.2025 17:22
gaaranoarena (@gaaranoarena@mastodon.social)

Por si alguien necesita organizar sus archivos personales

github.com/KotaroGa/File_Sorter




Show Original Post


07.12.2025 17:18
fcodvpt (@fcodvpt@framapiaf.org)

I was very interested to listen to @sheena " Modern frontend development the simple way" talk.

youtube.com/watch?v=9fm9DgA754

I really want to try #htmx one day. I discovered Alpine.js has to be considered

#pyladiescon #python




Show Original Post


1 ...859 860 861 862 863 864 865 866 867 868 869 ...1571
UP