(self, str, colwidth)
return ' ' * prefix + str + ' ' * suffix
Center-pads a string to the given column width using spaces.
Center-pads a string to the given column width using spaces.
Center - pads a string to the given column width using spaces .
def _pad_string(self, str, colwidth):
        """Center-pads a string to the given column width using spaces."""
        width = self._disp_width(str)
        prefix = (colwidth - 1 - width) // 2
        suffix = colwidth - prefix - width
        return ' ' * prefix + str + ' ' * suffix
def _pad_string ( self , str , colwidth ) : width = self . _disp_width ( str ) prefix = ( colwidth - 1 - width ) // 2 suffix = colwidth - prefix - width return ' ' * prefix + str + ' ' * suffix