Python f-strings. Formating faster and better

Опубликовано: 13 Ноябрь 2024
на канале: Professor Gerry Jenkins
1,165
21

Formatting data into strings for the user or other consumption is now faster and easier with python f-strings since python 3.6. This will give you the basics.

Links:
F-string pep498: https://docs.python.org/3/whatsnew/3....
Format Specification Mini-Language: https://docs.python.org/3.4/library/s...
Format examples: https://docs.python.org/3.4/library/s...
PEP 3101 -- Advanced String Formatting: https://www.python.org/dev/peps/pep-3...

Format cheat sheet: https://kapeli.com/cheat_sheets/Pytho...

Code for last example: https://gist.github.com/gerryjenkinsl...