Chapter 12
Standard Output and Standard Error

We’ve completed two pieces of our puzzle: acquiring text and processing it. The final part of a text processing job is usually to output the text somewhere—the “load” part of the “extract, transform, load” process.

There’s a bewildering array of places we might want to write our text to and formats in which we might want to write it: to the screen or to files; in JSON or as a CSV; as simple output or using complex, interpreted templates.

The place of first resort, though—for the simplest scripts and at the earliest point of even complex applications—is to write to standard output. We investigated its sibling, standard input, in Chapter 2, Processing Standard Input, where we used it to read text both from the user’s keyboard and from other processes. Standard output complements standard input well, as you might expect. Let’s take a look at what it can do.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.141.220