Today, I'm spending the day learning in public about socket programming (in Python π).
My starting point is this:
βI think sockets are like tunnels/roads that allow different programs to talk to each other directly.β
This π§΅ will evolve as I learn and experiment π
My idea is to experiment a bit with sockets in the REPL, then probably build a toy program that uses sockets to send random information through sockets.
I have been tweeting about Python π string formatting.
I have been preaching π that f-strings are the best string formatting alternative.
Then comes the string method `.format`.
And only then, %-formatting.
Here is a thread π§΅ comparing the 3 π
In its most basic form,
π %-formatting uses % and a letter inside the string
π `.format` replaces sequences of {} with the data
π f-strings use {} to insert the data _inside_ the string
Here is how it looks like π
An undervalued feature of string formatting is that you can easily determine whether your data should be formatted with its string (str) or with its representation (repr).