The "loop and a half"

Chris Angelico rosuav at gmail.com
Fri Oct 6 22:18:46 EDT 2017


On Sat, Oct 7, 2017 at 12:50 PM, Steve D'Aprano
<steve+python at pearwood.info> wrote:
> On Sat, 7 Oct 2017 06:21 am, Chris Angelico wrote:
>
>> I'm not sure what printing to a window or image would mean, or how
>> it's useful, but sure.
>
> Print to window: Print Preview.
>
> Print to image: export to pdf or jpg or png.

Except that that isn't what you get in his programming language. What
you seem to get (judging from his response to the post you're quoting)
is something that lets you treat a GUI window as if it were a console,
printing text to it in some sort of "glass teletype" way. Leaves me
wondering if he's ever taken one of his apps to a system that uses a
different default font, or anything like that. Unless all his GUIs are
built in HTML?

> More useful for rich GUI apps than plain old text apps, but the basic
> principle is still sound. I recently had a HUGE LibreOffice draw document,
> containing a very long mathematical formula, and the only practical way for
> me to turn it into an image was by taking 14 screenshots and then merging
> them by hand. A working export to PNG command would have been really useful.

Yes, absolutely agree. But personally, I'd have looked for a "print to
PS" of some sort, using a gigantic 'page' size, and then convert the
PS to PNG. I don't know for certain that I can do the latter
conversion, but there are a couple of places I'd look, including the
image processing module in a language's standard library ("does this
support postscript load?") and typing "ps2" in the terminal and
hitting Tab twice.

ChrisA



More information about the Python-list mailing list