MCPcopy Index your code
hub / github.com/python/cpython / formatstring

Function formatstring

Lib/calendar.py:824–827  ·  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

822
823
824def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
825 """Returns a string formatted from n strings, centered within n columns."""
826 spacing *= ' '
827 return spacing.join(c.center(colwidth) for c in cols)
828
829
830EPOCH = 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…