MCPcopy Index your code
hub / github.com/RustPython/RustPython / formatstring

Function formatstring

Lib/calendar.py:791–794  ·  view source on GitHub ↗

Returns a string formatted from n strings, centered within n columns.

(cols, colwidth=_colwidth, spacing=_spacing)

Source from the content-addressed store, hash-verified

789
790
791def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
792 """Returns a string formatted from n strings, centered within n columns."""
793 spacing *= ' '
794 return spacing.join(c.center(colwidth) for c in cols)
795
796
797EPOCH = 1970

Callers 3

formatyearMethod · 0.85
formatyearMethod · 0.85
formatFunction · 0.85

Calls 2

joinMethod · 0.45
centerMethod · 0.45

Tested by

no test coverage detected