Center string. >>> _padboth(6, '\u044f\u0439\u0446\u0430') == ' \u044f\u0439\u0446\u0430 ' True
(width, s)
| 1087 | |
| 1088 | |
| 1089 | def _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 | |
| 1100 | def _padnone(ignore_width, s): |