Print the longest and shortest lines in a text file with #Python #12
#!/usr/bin/python3
with open("kjv.txt") as file:
print("Shortest verse: ",min(file,key=len))
with open("kjv.txt") as file:
print("Longest verse: ",max(file,key=len))

Here are some links to different resources, the lists continue to grow.
#LLM https://app.dotadda.io/teams/5161c3d6-3ebb-4300-ba7c-f42c23ff42fc/dots
#RStats https://app.dotadda.io/teams/bad2fd50-1971-4103-903a-4c6406e3f445/dots
#Python https://app.dotadda.io/teams/ab732481-52f3-4388-896c-23d34e828b35/dots
I use DoTadda Dots https://www.dotadda.io
Huh. #til that a) TI makes a calculator that runs #Python code, b) #CircuitPython is a thing - and it's from adafruit, though that's in part their packaging of MicroPython, c) my wondering which version it's based on is probably completely silly (or stupid) seeing as how Python 3 has been around longer than any kids likely to be using Python on "approved for school" devices like calculators (or at least longer than they've been using calculators)

Although I've used python's matplotlib for years, it has always been a case of hacking together code snippets from the web.
Why? Because I don't think there is a unified, coherent, consistent design philosophy. If there is, I have never found it in all these years.
I keep reading that the Grammar of Graphics is the solution - an actually designed framework which has been implemented first and foremost in R, but python implementations exist too.
What do people think?
I'd welcome your thoughts before I invest time in learning some grammar of graphics and maybe trying a library like plotnine.
Are my expectations of Grammar of Graphics too high?
cc @nrennie
#python #R #ggplot2 #grammarofgraphics #visualisation #dataviz
Random band name generator with #Python #11
#!/usr/bin/python3
import random
with open("band.txt") as f:
words = [w.strip() for w in f if w.strip()]
def make_band_name():
n = random.choice([2, 3])
return " ".join(random.sample(words, n))
for _ in range(10):
print(make_band_name())
Surf Spooky Baby
Contaminated Digestion Tango
Free Pistols
Arthur We're Beat
Carnage Bull Mogen
Throwing Breast
Cool Balls
Vomit Liberty Beer
Charlie Death
Cheesecake Style
Azure AI Document Intelligenceの前処理:Word/Excelのルビ(ふりがな)を除去する
https://qiita.com/abachan/items/27e870fbb2675050ae97?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
#qiita #Python #Windows #Azure #ライブラリ #DocumentIntelligence
As inscrições para os tutoriais da Python Brasil 2025 abrem dia 22 de setembro, às 8h da manhã 🐍 🔥 E serão realizadas pelo Eventbrite (mesmo link dos ingressos de palestras)
Tutoriais são atividades gratuitas, e você pode se inscrever em mais de um tutorial (desde que os horários não sejam conflitantes).
Confira a programação 📅 e planeje com calma em quais dessas atividades incríveis você quer participar ♥️
https://talks.python.org.br/pythonbrasil-2025/schedule/
#python #pythonbrasil #bolhadev

Let's see if we can get a local python group going.
More to follow.
#python
Что такое эмбеддинги и как с ними работать. Вводная для начинающих
В этой статье будет рассказано об эмббедингах и методах работы с ними. Расскажу немного математики и приведу много примеров на Python. 🔥 Начинаем? 🔥
https://habr.com/ru/articles/947216/
#nlp #python #embeddings #что_такое_эмбеддинги
The package for computing periods of algebraic varieties, relying on Picard-Lefschetz theory, by E. Pichon-Pharabod now runs in #Python using the modularized distributions of the #SageMath library provided by the passagemath project.
github.com/ericpipha/le...
GitHub - ericpipha/lefschetz-f...
Calculate Easter for 1900-2368 with #Python #86
#!/usr/bin/python3
import sys
y=int(sys.argv[1]);c=y//100;n=y-19*(y//19);k=(c-17)//25
i=c-c//4-(c-k)//3+19*n+15;i-=30*(i//30)
i-=(i//28)*(1-(i//28))*(29//(i+1))*((21-n)//11)
j=y+y//4+i+2-c+c//4;j-=7*(j//7)
l=i-j;m=3+(l+40)//44;d=l+28-31*(m//4)
print(f"{m}/{d}/{y}")

When I write tests for code, I often include references to TV or books or other such things.
If I need a text string, I rarely do "Hello World". I used to do "Hello Kitty" but these days I usually use "Hi Bob" (from For All Mankind). I even added a test API header "X-Hi: Bob" the other day. 😁
For errors I often go with "Out of cheese error" or "Divide by cucumber error" from Discworld.
#Code #Python #Pytest #SciFi #Discworld