def _prtstr ( self , obj , dashes ) : self . prt . write ( '{DASHES:{N}}' . format ( DASHES = self . fmt_dashes . format ( DASHES = dashes , ID = obj . item_id ) , N = self . dash_len ) ) self . prt . write ( "{INFO}\n" . format ( INFO = str ( obj ) ) )
python print format items
Print object information using a namedtuple and a format pattern .
def _prtstr(self, obj, dashes):
        """Print object information using a namedtuple and a format pattern."""
        self.prt.write('{DASHES:{N}}'.format(
            DASHES=self.fmt_dashes.format(DASHES=dashes, ID=obj.item_id),
            N=self.dash_len))
        self.prt.write("{INFO}\n".format(INFO=str(obj)))