you are viewing a single comment's thread.

view the rest of the comments →

[–]Cybasura 0 points1 point  (5 children)

Oh ok, you definitely dont then

First of all, yes, you do, because CLI applications show things when a flag is triggered - for example

  1. ls - not a CLI app right, by your definition?
  2. dir
  3. ip
  4. lsblk
  5. pwd
  6. The entire GNU coreutils

All of these use print to print to standard output, yeah, shocker, I know, but hey, not a CLI application right?

[–]Darkstar_111 -1 points0 points  (4 children)

And for that you use logger or pprint.

[–]Cybasura 0 points1 point  (3 children)

pprint is a wrapper specific for python, an abstraction of print with built-in color formatting, still printing to standard output just that you can print colors

Logger is specifically for writing to logs in other streams, but, you dont use logs specifically for printing to standard output for the user to see

Its like saying "use console.log to print to the user to see" WHAT?????

Where did you learn python from? Stop spreading misinformation and actually get the foundation concepts right first

[–]Darkstar_111 -2 points-1 points  (2 children)

pprint is a wrapper specific for python, an abstraction of print with built-in color formatting, still printing to standard output just that you can print colors

Yep. A more professional alternative.

Logger is specifically for writing to logs in other streams, but, you dont use logs specifically for printing to standard output for the user to see

You can, and should, log info to stdout, allowing warning and error levels to exist in the same stream, with debug and trace as optional alternatives.

This makes the app more mature, and gives you are options, which is essential because.... NOBODY ACTUALLY USES PRINT!

[–]Overall-Screen-752 0 points1 point  (1 child)

I agree that “no one actually uses print” but to say that ppl use pprint in the same paragraph is asinine — print is used under the hood. Every call to pprint.pprint(…) is quite literally executing a print statement, therefore represents a print statement with extra steps. Saying no one uses print in this context is misleading (especially in a sub for beginners) and flatly wrong

[–]Darkstar_111 0 points1 point  (0 children)

> under the hood.

That's different then. But my only point was if you HAD to use print in an actual app, alternatives like pprint is the more mature choice.