MCPcopy Index your code
hub / github.com/astanin/python-tabulate / _padboth

Function _padboth

tabulate/__init__.py:1089–1097  ·  view source on GitHub ↗

Center string. >>> _padboth(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430 ' True

(width, s)

Source from the content-addressed store, hash-verified

1087
1088
1089def _padboth(width, s):
1090 """Center string.
1091
1092 >>> _padboth(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430 '
1093 True
1094
1095 """
1096 fmt = "{0:^%ds}" % width
1097 return fmt.format(s)
1098
1099
1100def _padnone(ignore_width, s):

Callers 1

_align_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected