Python Tip #3 (of 365):
Learn about the common string formatting specifications. No need to memorize them, but learn which ones exist as it'll help you remember to look them up when you need them.
F-strings allow using a `:` to specify a format specification within their replacement fields (the `{`...`}` parts).
For example, you can format a number to show as thousands separators:
>>> amount = 3280
>>> f"{amount:,}"
'3,280'
(1/4) π§΅
Many of the small, repetitive tasks we do on our computers every day can be automated once you understand the underlying patterns.
Automate the Boring Stuff with Python Workbook reinforces those patterns through guided practice, projects, and full solutions so you can confidently build your own scripts. Available now at major retailers.
https://nostarch.com/automate-workbook
#Python #Automation #coding #programming

After about 4 months of sporadic work, and a good focus now in the summer holiday, I have a new pre-release of a #GUI editor for nodes and edges #Graph s, which support multi-point edges, both rectilinear and curved, as well as managing metadata on the nodes.
A blog post will follow.
https://github.com/ghillebrand/qtPyGraphEdit
Oudemansiella mucida
PH Stefano Menchetti
Toscana, Italy
2016-10-01 09:03:00 UTC
http://www.inaturalist.org/observations/4251448
#iNaturalist #Nature #Wild #Python #FedivEarth #Environment

Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΡΠ²ΠΎΠΉ ΠΏΡΠΎΠ΅ΠΊΡΠ½ΡΠΉ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊ Π°Π²ΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ API [Π§Π°ΡΡΡ 1/3]
ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΠ·ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ API ΡΠ°ΡΡΠΎ Π½Π°ΡΠΈΠ½Π°Π΅ΡΡΡ Ρ ΠΏΡΠΎΡΡΡΡ ΡΠ΅ΡΠ΅Π½ΠΈΠΉ Π² Π²ΠΈΠ΄Π΅ ΠΊΠΎΠ»Π»Π΅ΠΊΡΠΈΠΉ Postman ΠΈΠ»ΠΈ ΡΠΊΡΠΈΠΏΡΠΎΠ² Π½Π° ΠΊΠΎΠ»Π΅Π½ΠΊΠ΅. Π’Π°ΠΊΠΎΠΉ ΠΏΠΎΠ΄Ρ ΠΎΠ΄ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π½Π° ΡΡΠ°ΡΡΠ΅, Π½ΠΎ Π±ΡΡΡΡΠΎ ΠΈΡΡΠ΅ΡΠΏΡΠ²Π°Π΅Ρ ΡΠ΅Π±Ρ. Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ½ΠΎΠ³ΠΎ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠ° ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΡΠΎΠ·Π½Π°Π½Π½ΡΠΌ ΠΏΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΎΠΌ ΠΎΡ Ρ Π°ΠΎΡΠΈΡΠ½ΠΎΠΉ, ΡΡΠ°Π³ΠΌΠ΅Π½ΡΠ°ΡΠ½ΠΎΠΉ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΠΈ ΠΊ ΡΡΡΠΎΠΉΡΠΈΠ²ΠΎΠΉ, Π³ΠΈΠ±ΠΊΠΎΠΉ ΠΏΡΠ΅Π΄ΡΠΊΠ°Π·ΡΠ΅ΠΌΠΎΠΉ ΠΈ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΡΠ΅ΠΌΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ. Π’Π°ΠΊΠΎΠΉ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊ Π΄Π°Π΅Ρ ΠΏΠΎΠ»Π½ΡΠΉ ΠΊΠΎΠ½ΡΡΠΎΠ»Ρ Π½Π°Π΄ Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠΎΠΉ, ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠΈΠ²Π°Π΅Ρ ΡΡΡΠΎΠ³ΡΡ Π²Π°Π»ΠΈΠ΄Π°ΡΠΈΡ ΠΊΠΎΠ½ΡΡΠ°ΠΊΡΠΎΠ² API, Π±Π΅Π·ΠΎΠΏΠ°ΡΠ½ΡΡ ΡΠ°Π±ΠΎΡΡ Ρ Π±Π°Π·ΠΎΠΉ Π΄Π°Π½Π½ΡΡ , Π³Π΅Π½Π΅ΡΠ°ΡΠΈΡ ΠΎΡΠΌΡΡΠ»Π΅Π½Π½ΡΡ ΡΠ΅ΡΡΠΎΠ²ΡΡ Π΄Π°Π½Π½ΡΡ ΠΈ ΠΏΡΠΎΡΡΡΡ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΡ Π² ΠΈΠ½ΡΡΠ°ΡΡΡΡΠΊΡΡΡΡ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ. Π‘ΡΠ°ΡΡΡ ΠΏΠΎΠ΄Π΅Π»Π΅Π½Π° Π½Π° ΡΡΠΈ ΡΠ°ΡΡΠΈ. Π ΠΏΠ΅ΡΠ²ΠΎΠΉ ΡΠ°ΡΡΠΈ Π΄Π°Π΅ΡΡΡ ΠΎΠ±ΠΎΡΠ½ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΏΡΠ΅ΠΈΠΌΡΡΠ΅ΡΡΠ² ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΏΠΎΠ»Π½ΠΎΡΠ΅Π½Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ½ΠΎΠ³ΠΎ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠ° ΠΏΠΎ ΡΡΠ°Π²Π½Π΅Π½ΠΈΡ Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ Π³ΠΎΡΠΎΠ²ΡΡ ΡΠ½ΠΈΠ²Π΅ΡΡΠ°Π»ΡΠ½ΡΡ ΠΈΠ½ΡΡΡΡΠΌΠ΅Π½ΡΠΎΠ² ΠΏΠΎ ΡΠΈΠΏΡ Postman. ΠΡ ΡΠ·Π½Π°Π΅ΡΠ΅, ΠΊΠ°ΠΊΠΈΠ΅ ΠΏΡΠΈΠ½ΡΠΈΠΏΡ Π»Π΅Π³Π»ΠΈ Π² ΠΎΡΠ½ΠΎΠ²Ρ Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΡ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠ° ΠΈ ΠΊΠ°ΠΊΠΎΠΉ Π±ΡΠ» ΠΏΠΎΠ΄ΠΎΠ±ΡΠ°Π½ ΡΠ΅Ρ Π½ΠΎΠ»ΠΎΠ³ΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΡΠ΅ΠΊ Π΄Π»Ρ ΠΈΡ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π½Π° ΠΏΡΠ°ΠΊΡΠΈΠΊΠ΅. Π‘ΡΠ°ΡΡΡ ΡΠ΅Ρ Π½ΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΈ Π°Π΄ΡΠ΅ΡΠΎΠ²Π°Π½Π° ΠΈΠ½ΠΆΠ΅Π½Π΅ΡΠ°ΠΌ-ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΡΠ°ΠΌ Π² ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠΈ (SDET) ΠΈ ΠΈΠ½ΠΆΠ΅Π½Π΅ΡΠ°ΠΌ ΠΏΠΎ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΠΈ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΠ΅ΡΠ΅ΡΠ»ΠΈ ΠΎΡ Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΡ ΠΎΠ±ΠΎΡΠΎΠ±Π»Π΅Π½Π½ΡΡ ΡΠ΅ΡΡΠΎΠ² ΠΊ ΠΎΡΠΎΠ·Π½Π°Π½Π½ΠΎΠΌΡ ΠΏΡΠΎΠ΅ΠΊΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠ΅ΡΡΠΎΠ²ΠΎΠ³ΠΎ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠ° ΠΈΠ»ΠΈ ΡΠΎΠ»ΡΠΊΠΎ Π½Π°ΡΠΈΠ½Π°ΡΡ ΡΡΠΎΡ ΠΏΠ΅ΡΠ΅Ρ ΠΎΠ΄.
https://habr.com/ru/articles/982624/
#python #ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠΈ_Π΄Π»Ρ_ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ #Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠ°_ΡΠΈΡΡΠ΅ΠΌΡ #ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ #ΠΏΡΠΎΠ΅ΠΊΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅_ΡΠΈΡΡΠ΅ΠΌ #Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΡ_ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ #apiΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ #ΡΠ»ΠΎΠΈΡΡΠ°Ρ_Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠ° #ΡΠ±ΠΎΡ_ΡΡΠ΅Π±ΠΎΠ²Π°Π½ΠΈΠΉ #ΠΏΡΠΈΠ½ΡΠΈΠΏΡ_ΠΏΡΠΎΠ΅ΠΊΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ
When NOT to use #Pydantic
https://ossa-ma.github.io/blog/when-not-to-use-pydantic
#Python #quantum computing - interesting
https://realpython.com/quantum-computing-basics/
Source code should be full of puns/references. Am I dealing with json? Method is called derulo(). Flipping & reversing an array? missy_elliot(). In my PDF manipulation software, there's three resize methods - fit, fill, and stretch, if you want to do all of them - that's called tpain_maino(). Sometimes I need to re-rasterize a PDF, that's bob_ziggy_damian() and if I have to really aggressively fix it (basically burn it down and redo all of it) that's seth_rollins(). #programming #coding #python
Use Pygame to visualize bubble sort in Python, Part 1
https://rodstephensbooks.com/bubble_sort2.html
#Python #Algorithms #Pygame #Animation

V - S1 EP14 Lab 9 - Machine Learning in Python - Introduction to Inheritance - Calling Parent Behaviour #machinelearningtutorial #mlforbeginners #machinelearningmodels #machinelearningbasics #datascienceforbeginners #softwaredeveloper #codingforbeginners #datascience #PythonForDataScience #pythoncoding #machinelearning #jupyternotebook #dataengineering #learntocode #algorithims #vscode #learnpython #python #statistics #jupyterlabs
#iwlwifi broke after a recent NixOS upgrade (firmware/kernel issue, not really distro-specific), but being forced #offline finally got me to work on my #OrgRoam memex.
Linked a bunch of lonely nodes together.
Once I got the network back online I even wrote some #Elisp to replace old link that point to files with UUID ones.
And yeah, I needed a search engine for that, because the built-in docs for #Emacs - while often handy - are lacking in examples and assume a bit too much up-front knowledge. I'm still not sure what the heck org-element-context returns and why I should need a special function to index it. Say what you will about the complexity of #JavaScript or #Python, having built-in data types for lists, sets, and maps makes it a lot easier to poke at data.
But at least I could hack together about half of it from offline sources.
One issue that surprised me is that default setup for editing ELisp in #DoomEmacs is still not entirely user friendly. Lots of things work out of the box, which is really cool, but some simple things like automatic indentation are not really consistent.
When I saved the file, it got reformatted in a way that broke its structure.
When I tried to de-indent a line, it deleted too much whitespace, instead of just going back a single level, so I had to use C-x TAB, which is unnecessarily many keystrokes for such a common operation.
All in all, I'm impressed at how productive I can be with it and I hope that the jankiness will be less of an issue once I've gained some Elisp experience.
Got an interesting comment from someone they are writing something to detect vibrations in machinery to reduce long term cost for rotating parts.
Pretty cool!
What are you working on in your communities?
#python #programming #engineering #SytemThinks