Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78102 > unrolled thread
| Started by | Nagy László Zsolt <gandalf@shopzeus.com> |
|---|---|
| First post | 2014-09-20 14:21 +0200 |
| Last post | 2014-09-20 14:21 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: pad binary string with a given byte value (python 3) Nagy László Zsolt <gandalf@shopzeus.com> - 2014-09-20 14:21 +0200
| From | Nagy László Zsolt <gandalf@shopzeus.com> |
|---|---|
| Date | 2014-09-20 14:21 +0200 |
| Subject | Re: pad binary string with a given byte value (python 3) |
| Message-ID | <mailman.14165.1411215717.18130.python-list@python.org> |
> bytes/str.ljust() > >>>> def pad(b, n=16, c=b"\x0f"): > ... length = (len(b)+n-1)//n*n > ... return b.ljust(length, c) Thanks! -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Back to top | Article view | comp.lang.python
csiph-web