Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the lines command
#1
the "lines" command has 3 or more arguments, start, end, name of file, and optionally more files. if given only 2 arguments, the input is from STDIN (sys.stdin). if a file is named "-" read STDIN in that order. "-" may be named only once. if the command is executed as a name without an 's' in the name then it takes only 1 numeric argument (the one line to print), instead of 2 (the range of lines to print). the line number begin with 0 and the range ends just before the 2nd number, just like Python list indexing and slicing.

one feature i want in this command is unbuffered line-by-line output, so that if it is piped input from a process that pauses its output, and its output is still within the specified range, that pause will be seen and lines before that pause are not delayed by buffering. this needs to work correctly in both python2 and python3 (same code in both).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020