pyformat.info
pyformat.info copied to clipboard
Single page cheat-sheet about Python string formatting
I come to this website every time I get confused about formatting my strings, thanks for the great content! I think it might be a good time to add f-Strings...
Would it be beneficial to add f-strings to this cheat sheet? I hope this is not vastly out the website's focus. ``` >>> import datetime >>> name = 'Fred' >>>...
Great resource! I would like to see a Dashdoc cheat sheet from this: https://github.com/Kapeli/cheatset#readme
There is a small typo in README.md. Should read `currently` rather than `curently`. Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md
I don't see any information on the %e or %g float formats.
Python added support for formatting numbers with thousands separators. This works for both floating point and integer numbers. Originally the comma separator was added. In Python 3.6, support for underscore...
>...This allows for re-arranging the order of display without changing the arguments. > This operation is not available with old-style formatting. This is false. Consider: ```'%(b)s %(a)s' % { 'a':...
Hey thanks for the nice cheat sheet! You're missing the optional thousands separator for numbers ``` '{:,}'.format(1000000) Output: 1,000,000 ```
`format_map(data)` was added specifically to improve the performance and behavior of `format(**data)`. I realize this isn't a feature in 2.7, but if you're adding f-strings they you should also mention...