A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/131161.html below:

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5Victor Stinner victor.stinner at gmail.com
Fri Jan 10 23:12:52 CET 2014
2014/1/10 Juraj Sukop <juraj.sukop at gmail.com>:
> In the case of PDF, the embedding of an image into PDF looks like:
>
>     10 0 obj
>       << /Type /XObject
>          /Width 100
>          /Height 100
>          /Alternates 15 0 R
>          /Length 2167
>       >>
>     stream
>     ...binary image data...
>     endstream
>     endobj

What not building "10 0 obj ... stream" and "endstream endobj" in
Unicode and then encode to ASCII? Example:

data = b''.join((
  ("%d %d obj ... stream" % (10, 0)).encode('ascii'),
  binary_image_data,
  ("endstream endobj").encode('ascii'),
))

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4