The "loop and a half"

2017-10-09 Thread Mikhail V
bartc wrote: >> Your job is to port an editor that people have been using for 30 years to >> Linux. The first thing you do is to change all the commands and shortcuts to >> match what is typical on Linux? So that no-one who was familiar with it as >> it was can actually use it? Chris Angelico

Re: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
On 2017-10-09 04:35, Mikhail V wrote: > Just for people like me who know nothing about networking, > can you popularly explain the : > >> Have you ever worked on a slow remote session where a GUI is >> completely impracticable (or maybe even unavailable), and redrawing >>

Re: The "loop and a half"

2017-10-09 Thread Lele Gaifax
Chris Angelico writes: >> Or you could use a GUI editor that runs locally and has the capability >> to edit files remotely over ssh. > > That's also a possibility, but I have yet to find one that can SSH to > a server as a non-root user and then sudo to edit the files. If it's

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 4:17 PM, Ian Kelly wrote: > On Sun, Oct 8, 2017 at 10:49 PM, Chris Angelico wrote: >> On Mon, Oct 9, 2017 at 3:35 PM, Mikhail V wrote: Have you ever worked on a slow remote session where a GUI is

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Grant Edwards wrote: Which took it from RSX-11. Or probably more specifically from FILES-11. I woldn't be surprised if the enineers at DEC got it from somewhere else before that. Quite possibly it goes back to the very earliest DEC OS that had files, whatever that was. The reason for it was

Re: The "loop and a half"

2017-10-08 Thread Ian Kelly
On Sun, Oct 8, 2017 at 10:49 PM, Chris Angelico wrote: > On Mon, Oct 9, 2017 at 3:35 PM, Mikhail V wrote: >>> Have you ever worked on a slow remote session where a GUI is >>> completely impracticable (or maybe even unavailable), and redrawing >>> the

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:35 PM, Mikhail V wrote: >> Have you ever worked on a slow remote session where a GUI is >> completely impracticable (or maybe even unavailable), and redrawing >> the screen is too expensive to do all the time? > > So where does the redrawing happen?

The "loop and a half"

2017-10-08 Thread Mikhail V
bartc wrote: >> But as it happens, I could make computers talk to each when I was working >> with microprocessors, using home-made interfaces, rs232 or rs423. I wouldn't >> know how to do it now because it depends on other people's over-complex >> tech. Chris Angelico wrote: > I don't know if

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: And within an application, it can do what it likes. With regards to editing, there are some common conventions that I absolutely hate: In other words, you would like all authors of text editors to adopt a certain set of conventions for these things. So much for each program "doing

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 19:10, Chris Angelico wrote: On Mon, Oct 9, 2017 at 3:50 AM, bartc wrote: You assume that since *you* have never needed to produce one lower-case letter in a block of upper-case, that "probably no one else has", and then you make it impossible to do that in

Re: The "loop and a half"

2017-10-08 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Oct 9, 2017 at 3:50 AM, bartc wrote: >> Yeah, well, some people like to be sheep, others like to be >> individuals**. > > Yeah, well, some people like to be standards-compliant, others like to > be irrelevant morons. Even being

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:50 AM, bartc wrote: > Yeah, well, some people like to be sheep, others like to be individuals**. Yeah, well, some people like to be standards-compliant, others like to be irrelevant morons. > I start in computing at a time when an application was the

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:37 AM, Stefan Ram wrote: > Gregory Ewing writes: >>bartc wrote: >>>Interactive Python requires quit() or exit(), complete with parentheses. >>Er, what? Ctrl-D works fine for me to exit Python when not >>in the midst

Re: OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread Leam Hall
On 10/08/2017 12:43 PM, Marko Rauhamaa wrote: leam hall : "Linux" means so many things to people. Yes, but just because someone can spell it doesn't mean they can redefine it. :) Closer to home, systemd has taken a central role in the main Linux distributions. I think

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 17:13, Chris Angelico wrote: On Mon, Oct 9, 2017 at 2:01 AM, bartc wrote: However as graphics became more mainstream then yes I did adopt some commonly expected styles (menubars for example). As for Alt-F4, if that generates a WM_CLOSE message for example, then I

Re: OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread Marko Rauhamaa
leam hall : > Colorized ls is something the distrobution people like and they put it > in. Others of us don't care for it. But it's not "Linux", is the > profile. Easy to customize. Easy and easy... "Linux" means so many things to people. For example, the recent "Linux

Re: OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread leam hall
On Sun, Oct 8, 2017 at 8:15 AM, Gregory Ewing wrote: > > The thing that *really* annoys me is Linux insisting on colourising > the output to a tty, since it invariably seems to pick an undreadable > colour scheme. And the case-insensitive sorting... there's a reason

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 2:01 AM, bartc wrote: > However as graphics became more mainstream then yes I did adopt some > commonly expected styles (menubars for example). As for Alt-F4, if that > generates a WM_CLOSE message for example, then I would be obliged to deal > with it.

Re: The "loop and a half"

2017-10-08 Thread Grant Edwards
On 2017-10-08, eryk sun wrote: > On Sun, Oct 8, 2017 at 10:12 AM, Steve D'Aprano > wrote: >> On Sun, 8 Oct 2017 02:06 am, bartc wrote: >> >>> Especially on >>> Windows where the usual Ctrl C doesn't work, so you resort to Ctrl-Break >>> will which

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
On 2017-10-08 12:53, Gregory Ewing wrote: > Peter J. Holzer wrote: >> In any case, that -E writes to stdout and -S to file is an inconsistency >> which looks more like a historical accident than a planned feature to >> me. > > A possible reason is that with -S there

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
On 2017-10-07 08:35, Steve D'Aprano wrote: > Unfortunately ESCAPE is already used. VT100 (the terminal emulation which is > used in just about all terminals) all control sequences begin with ESC. So > every time you do something like press an arrow key, the terminal

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
On 2017-10-07 13:19, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 11:06 pm, bartc wrote: >> However it does seem to expose a flaw in the ability of command line >> tools to work with non-command line tools. >> >> So I have to copy 33,000 lines from a document, > >

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 13:05, Chris Angelico wrote: On Sun, Oct 8, 2017 at 10:46 PM, bartc wrote: Just look at any interactive page on the web, they all work differently. People are used to it. And it allows innovation. Maybe it's just that you're not old enough to have worked

Re: The "loop and a half"

2017-10-08 Thread eryk sun
On Sun, Oct 8, 2017 at 10:12 AM, Steve D'Aprano wrote: > On Sun, 8 Oct 2017 02:06 am, bartc wrote: > >> Especially on >> Windows where the usual Ctrl C doesn't work, so you resort to Ctrl-Break >> will which actually abort it. Ctrl Z is uncommon. > > Thousands of

Re: OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread Lele Gaifax
Gregory Ewing writes: > The thing that *really* annoys me is Linux insisting on colourising > the output to a tty, since it invariably seems to pick an undreadable > colour scheme. And the case-insensitive sorting... there's a reason > Makefile starts with a capital

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Chris Angelico wrote: 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, It would be easy on MacOSX. Anything you can print can be sent to a PDF file, and

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: Interactive Python requires quit() or exit(), complete with parentheses. Er, what? Ctrl-D works fine for me to exit Python when not in the midst of entering a block. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Peter J. Holzer wrote: In any case, that -E writes to stdout and -S to file is an inconsistency which looks more like a historical accident than a planned feature to me. A possible reason is that with -S there is an obvious choice for the output file name, i.e. .s, but there is no conventional

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-08 Thread Gregory Ewing
Chris Angelico wrote: Hmm, but usually I would expect them still to HAVE those streams, they're just connected to /dev/null or something. I don't think they would actually fail to exist, would they? On unix there's nothing to stop you launching a process with fds 0, 1 and 2 all closed. It

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 12:22, Paul Moore wrote: When developing scripts, applications, or any form of code, I use good ideas from anywhere, as I doubt that I have the monopoly on knowing the perfect way to write code. Some of those good ideas come from Unix-based systems. That's not "because Linux is so

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: This preprocesses the code and shows the result. Typical programs will have many thousands of lines of output, but it just dumps it to the console. You /have/ to use '>' to use it practically (Windows doesn't really have a working '|' system.) This may be why you're having

OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread Gregory Ewing
Steve D'Aprano wrote: You don't think multiple columns in interactive mode is useful? The issue is not whether single vs. multi column mode is better, but whether it should automatically switch based on what kind of thing is connected to stdin. Personally I find that behavour surprising and

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: Then you might have 'sort' for the non-interactive version, and 'isort' or whatever for the interactive. It's pretty rare that you'd want to use 'sort' interactively, which is why your hypothetical 'isort' doesn't exist. However, it *is* common to use it as part of a pipeline,

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Sun, Oct 8, 2017 at 10:46 PM, bartc wrote: > On 07/10/2017 15:40, Steve D'Aprano wrote: >> >> On Sat, 7 Oct 2017 11:54 pm, bartc wrote: >> >>> So my programs that use Escape on Windows needed >>> to use Escape Escape on Linux to get around that. >> >> >> >> Or you could just

Re: The "loop and a half"

2017-10-08 Thread bartc
On 07/10/2017 15:40, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:54 pm, bartc wrote: So my programs that use Escape on Windows needed to use Escape Escape on Linux to get around that. Or you could just follow the expected Unix interface instead of inventing your own. Your job is to port

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Sun, Oct 8, 2017 at 10:22 PM, Paul Moore wrote: > On 8 October 2017 at 11:36, bartc wrote: >> Even with things like building applications (eg. trying to build CPython >> from sources), they are designed from the ground up to be inextricably >> linked to

Re: The "loop and a half"

2017-10-08 Thread Paul Moore
On 8 October 2017 at 11:36, bartc wrote: > Frustrating for whom? Well, me as well as Steve, if we're counting votes for who finds your attitude frustrating... > It seems to me that it's pretty much everyone here who has an overbearing > sense of superiority in that everything

Re: The "loop and a half"

2017-10-08 Thread Marko Rauhamaa
bartc : > It seems to me that it's pretty much everyone here who has an > overbearing sense of superiority in that everything that Unix or Linux > does is a million times better than anything else. People's opinions don't matter here. Point is, if you are writing software for

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 10:12, Steve D'Aprano wrote: On Sun, 8 Oct 2017 02:06 am, bartc wrote: Thousands of Python programmers on Windows successfully learned to use Ctrl-Z ENTER back in the days of Python 1.5, before quit/exit were added as a convenience for beginners, and many of them probably still

Re: The "loop and a half"

2017-10-08 Thread Steve D'Aprano
On Sun, 8 Oct 2017 02:06 am, bartc wrote: >> On 2017-10-07, bartc wrote: >> >>> Interactive Python requires quit() or exit(), complete with parentheses. ...^ >> Nonsense. On Unix you can just press ctrl-D (or whatever you have >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-07 Thread Richard Damon
On 10/4/17 11:22 PM, Steve D'Aprano wrote: The A and E in the word "are" are not vowels, since they are silent. The A is clearly not silent, unless you have some strange pronunciation. The fact that are is pronounced just like the NAME of the letter R doesn't mean it is silent. Compare the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-07 Thread Pavol Lisy
On 10/5/17, Steve D'Aprano wrote: > The A and E in the word "are" are not vowels, since they are silent. Interesting! :) Is then R (half?) silent in word "Brazil"? -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-07 Thread Terry Reedy
On 10/7/2017 10:45 AM, Grant Edwards wrote: On 2017-10-07, bartc wrote: Interactive Python requires quit() or exit(), complete with parentheses. Nonsense. On Unix you can just press ctrl-D (or whatever you have configured as eof) at the command prompt. On windows, it's

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 17:28, Steve D'Aprano wrote: On Sun, 8 Oct 2017 01:15 am, bartc wrote: You do remember this was about using programs /like/ sort as a model for writing true interactive scrolling text apps? I don't remember any such thing. I remember you *claiming* that, but if anyone actually

Re: The "loop and a half"

2017-10-07 Thread Grant Edwards
On 2017-10-07, Steve D'Aprano wrote: > sort *could* detect when it is reading from stdin interactively and give an > introductory message. There are some command-line utilities that try to do that: they modify their behavior when they think that stdin or stdout is

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sun, 8 Oct 2017 01:15 am, bartc wrote: > On 07/10/2017 14:19, Steve D'Aprano wrote: >> On Sat, 7 Oct 2017 11:06 pm, bartc wrote: > >>> So I have to copy 33,000 lines from a document, >> >> Don't be daft. Nobody says that stdin is a sufficient interface for a >> heavy-weight task like that.

Re: The "loop and a half"

2017-10-07 Thread Michael Torrie
On 10/06/2017 07:24 AM, bartc wrote: > On 06/10/2017 14:11, Peter J. Holzer wrote: >> I regularly use at least cat, wc and od this way (plus a few of my own >> utilities like utf8dump). I'm sure I've used sort this way, too, though >> rather rarely. I usually don't type the input but paste it in,

Re: The "loop and a half"

2017-10-07 Thread Chris Angelico
On Sun, Oct 8, 2017 at 2:06 AM, bartc wrote: > On 07/10/2017 15:45, Grant Edwards wrote: >> Admit it, you're just trolling. > > FFS, NOW what's wrong? > > IF you DO redefine those names, then you DO have to use other means to > terminate. I happen to call those means 'crashing

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sun, 8 Oct 2017 12:49 am, bartc wrote: > On 07/10/2017 14:19, Steve D'Aprano wrote: >> On Sat, 7 Oct 2017 11:06 pm, bartc wrote: > >> Ctrl-K to enter "operate on selected text" mode; >> Y to Delete >> Ctrl-K to enter "operate on selected text" mode; >> R to Read from a file (at last an actual

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 15:45, Grant Edwards wrote: On 2017-10-07, bartc wrote: Interactive Python requires quit() or exit(), complete with parentheses. Nonsense. On Unix you can just press ctrl-D (or whatever you have configured as eof) at the command prompt. On windows, it's

Re: The "loop and a half"

2017-10-07 Thread eryk sun
On Sat, Oct 7, 2017 at 1:06 PM, bartc wrote: > > So I have to copy 33,000 lines from a document, get to the terminal (keeping > that document open because I'm not done with it), start 'sort', and paste > those 33,000 lines into the console, then type Ctrl-D. Which then promptly >

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-07 Thread Grant Edwards
On 2017-10-07, Steve D'Aprano wrote: > They're probably to busy re-doing working programs from scratch every > few versions, with a brand new "improved" UI (almost invariably > including a kool new design that uses light grey text on an ever so > slightly lighter grey

Re: The "loop and a half"

2017-10-07 Thread Grant Edwards
On 2017-10-07, bartc wrote: > Interactive Python requires quit() or exit(), complete with parentheses. Nonsense. On Unix you can just press ctrl-D (or whatever you have configured as eof) at the command prompt. On windows, it's Ctrl-Z . > Unless you've redefined quit and exit

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 11:54 pm, bartc wrote: > So my programs that use Escape on Windows needed > to use Escape Escape on Linux to get around that. Or you could just follow the expected Unix interface instead of inventing your own. Back in the days when I used a Mac (long before OS X), I used to

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 14:19, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:06 pm, bartc wrote: So I have to copy 33,000 lines from a document, Don't be daft. Nobody says that stdin is a sufficient interface for a heavy-weight task like that. With 33000 lines of text, I absolutely would save them to a

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 14:19, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:06 pm, bartc wrote: Ctrl-K to enter "operate on selected text" mode; Y to Delete Ctrl-K to enter "operate on selected text" mode; R to Read from a file (at last an actual mnemonic command!) enter a file name That's five steps.

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 11:06 pm, bartc wrote: > That's not entering the data interactively (such as typing 'sort' then > it sits silently recording lines of text (you hope) until it sees EOF). I manually hit paste, that's just as much a form of data entry as typing characters one at a time. And then

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 09:35, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:05 am, bartc wrote: Um, that actually follows what interactive Python does. What is "that" to which you refer? If you mean, "what I, Bart C, suggested, namely having the program exit on a blank line", then you are wrong. In

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 03:18, Chris Angelico wrote: On Sat, Oct 7, 2017 at 12:50 PM, Steve D'Aprano 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

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 02:46, Steve D'Aprano wrote: On Sat, 7 Oct 2017 06:18 am, bartc wrote: For sort, there is no real need. You use a text editor to create your data. Then use existing file-based sort. What you mean is, *you* see no need for sorting interactively, or sorting as part of a pipeline

Re: Warnings (was Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"])

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 12:09 pm, Chris Angelico wrote: > So the question is: is it right for a library to raise > console warnings like that? Under what circumstances and to what > destinations should a library report on potential problems? Of course they should -- and applications should be free to

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 07:01 am, bartc wrote: > On 06/10/2017 20:38, Grant Edwards wrote: >> On 2017-10-06, bartc wrote: >> >>> For sort, there is no real need. You use a text editor to create >>> your data. Then use existing file-based sort. >> >> I sort streams on stdin far more

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-07 Thread Terry Reedy
On 10/6/2017 8:19 PM, Steve D'Aprano wrote: On Sat, 7 Oct 2017 05:33 am, Grant Edwards wrote: On 2017-10-06, Marko Rauhamaa wrote: The reason a daemon usually opens dummy file descriptors for the 0, 1 and 2 slots is to avoid accidents. Some library might assume the

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 12:12 am, Paul Moore wrote: > What really bugs me is colour settings that default to dark blues on > a black background. Amen to that! Between the very low contrast, and the stereopsis whereby blues appear to recede into the distance (and bright red pull forward, appearing to

Re: The "loop and a half"

2017-10-07 Thread Steve D'Aprano
On Sat, 7 Oct 2017 11:05 am, bartc wrote: > On 07/10/2017 00:43, Steve D'Aprano wrote: >> On Sat, 7 Oct 2017 12:24 am, bartc wrote: >> >>> print ("Enter blank expression to quit.") >> >> >> I *despise* programs that do that, and would cheerfully and >> unapologetically take their designers,

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 12:50 PM, Steve D'Aprano 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

Re: The "loop and a half"

2017-10-06 Thread Steve D'Aprano
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. More useful for rich GUI apps than plain old text apps, but the basic

Re: The "loop and a half"

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 06:18 am, bartc wrote: > For sort, there is no real need. You use a text editor to create your > data. Then use existing file-based sort. What you mean is, *you* see no need for sorting interactively, or sorting as part of a pipeline of functions. That speaks more of your lack

Re: The "loop and a half"

2017-10-06 Thread Ben Bacarisse
bartc writes: > On 07/10/2017 01:14, Ben Bacarisse wrote: >> bartc writes: >> >>> On 06/10/2017 14:35, Paul Moore wrote: On 6 October 2017 at 13:56, bartc wrote: > If you don't like the word 'crude', try 'lazy'. Take this example of

Warnings (was Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"])

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 11:19 AM, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 05:33 am, Grant Edwards wrote: > >> On 2017-10-06, Marko Rauhamaa wrote: >> >>> The reason a daemon usually opens dummy file descriptors for the 0, 1 >>> and 2 slots is to

Re: The "loop and a half"

2017-10-06 Thread bartc
On 07/10/2017 01:14, Ben Bacarisse wrote: bartc writes: On 06/10/2017 14:35, Paul Moore wrote: On 6 October 2017 at 13:56, bartc wrote: If you don't like the word 'crude', try 'lazy'. Take this example of the gcc C compiler: > gcc -E program.c This

Re: The "loop and a half"

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 05:56 am, Chris Angelico wrote: > On Sat, Oct 7, 2017 at 5:47 AM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: Personally, I think stdin is a bit lame as a

Re: The "loop and a half"

2017-10-06 Thread Ben Bacarisse
bartc writes: > It is anyway not really acceptable these days for a long list of data > to simply be typed in like that without any feedback at all. And 100% > dependent on your typing Ctrl-D at the end and not Ctrl-C by > mistake. This is not still the 1970s. It was not

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 05:33 am, Grant Edwards wrote: > On 2017-10-06, Marko Rauhamaa wrote: > >> The reason a daemon usually opens dummy file descriptors for the 0, 1 >> and 2 slots is to avoid accidents. Some library might assume the >> existence of those file descriptors. For

Re: The "loop and a half"

2017-10-06 Thread Ben Bacarisse
bartc writes: > On 06/10/2017 14:35, Paul Moore wrote: >> On 6 October 2017 at 13:56, bartc wrote: >>> If you don't like the word 'crude', try 'lazy'. Take this example of the gcc >>> C compiler: >>> >>> > gcc -E program.c >>> >>> This preprocesses the code

Re: The "loop and a half"

2017-10-06 Thread bartc
On 07/10/2017 00:43, Steve D'Aprano wrote: On Sat, 7 Oct 2017 12:24 am, bartc wrote: print ("Enter blank expression to quit.") I *despise* programs that do that, and would cheerfully and unapologetically take their designers, disguise them as a lettuce, and stake them out to be nibbled to

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Ben Bacarisse
Steve D'Aprano writes: > On Fri, 6 Oct 2017 09:33 pm, Ben Bacarisse wrote: > >> A general solution to the (rather odd) complaint about silent waiting >> should really check any input fileno to see if a prompt is needed.  You >> could argue, though, that anyone who's

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 10:49 AM, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 01:55 am, Chris Angelico wrote: > >> Since GCC is the GNU Compiler *Collection* > > Today I Learned that gcc doesn't mean "Gnu C Compiler". > > I knew gcc compiles C, C++, Objective C and

Re: The "loop and a half"

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 01:55 am, Chris Angelico wrote: > Since GCC is the GNU Compiler *Collection* Today I Learned that gcc doesn't mean "Gnu C Compiler". I knew gcc compiles C, C++, Objective C and Objective C++, but today I discovered it also compiles Ada, Fortran, Java and "treelang", whatever

Re: The "loop and a half"

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 12:24 am, bartc wrote: > print ("Enter blank expression to quit.") I *despise* programs that do that, and would cheerfully and unapologetically take their designers, disguise them as a lettuce, and stake them out to be nibbled to death by snails. At the interactive prompt, I

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 7:32 AM, bartc wrote: > On 06/10/2017 20:21, Chris Angelico wrote: >> >> On Sat, Oct 7, 2017 at 5:51 AM, bartc wrote: > > >>> If you're stuck, whip out a tablet computer or smartphone (they should >>> still >>> function without

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread eryk sun
On Fri, Oct 6, 2017 at 4:27 PM, Thomas Jollans wrote: > On 2017-10-06 17:01, eryk sun wrote: >> >> POSIX defines STDIN_FILENO as 0, and the Windows C runtime reserves FD >> 0 to map to the native StandardInput handle. But as I noted in a >> previous message, on Windows isatty(0)

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 20:21, Chris Angelico wrote: On Sat, Oct 7, 2017 at 5:51 AM, bartc wrote: If you're stuck, whip out a tablet computer or smartphone (they should still function without connectivity) and use a preloaded text editor. Or just compose and then save an email. Even

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Terry Reedy
On 10/6/2017 1:32 PM, Chris Angelico wrote: On Sat, Oct 7, 2017 at 4:05 AM, Grant Edwards wrote: On 2017-10-06, Thomas Jollans wrote: Seriously? sys.stdin can be None? That's terrifying. Why? Unix daemons usually run with no stdin, stderr, or

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 20:38, Grant Edwards wrote: On 2017-10-06, bartc wrote: For sort, there is no real need. You use a text editor to create your data. Then use existing file-based sort. I sort streams on stdin far more often than I sort named files. So what's been established

Re: The "loop and a half"

2017-10-06 Thread Marko Rauhamaa
Grant Edwards : > I'm always amazed how long it takes people to accomplish simple tasks > when they refuse to use anything other than eclipse and a web browser. Now I can bring this back to Python. I have had a huge task of arranging 1000+ soccer games in a tournament.

Re: The "loop and a half"

2017-10-06 Thread Marko Rauhamaa
bartc : >> Personally, I think stdin is a bit lame as a stimulus source for an >> interactive program. That's not even what stdin is primarily meant for; >> stdin is meant to be the input data for a job. Similarly, stdout is >> meant to be the result of the computation. Stderr,

Re: The "loop and a half"

2017-10-06 Thread Grant Edwards
On 2017-10-06, bartc wrote: > For sort, there is no real need. You use a text editor to create > your data. Then use existing file-based sort. I sort streams on stdin far more often than I sort named files. -- Grant Edwards grant.b.edwardsYow! Do you

Re: The "loop and a half"

2017-10-06 Thread Grant Edwards
On 2017-10-06, Chris Angelico wrote: > Some are. Many aren't. In fact, the basic terminal has many advantages > over purely GUI systems, including that you can scroll back and see > exactly what happened previously. I generally recommend my students to > use a sophisticated

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 6:18 AM, bartc wrote: >> I don't know if anybody has seen a market/need for an interactive sort >> program, but there's nothing preventing you from writing one. > > > For sort, there is no real need. You use a text editor to create your data. > Then use

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 5:51 AM, bartc wrote: > On 06/10/2017 18:42, Chris Angelico wrote: >> >> On Sat, Oct 7, 2017 at 4:13 AM, bartc wrote: > > >>> So what's the excuse for an unresponsive text display in 2017? >> >> >> Got it. You assume that a system is a

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 18:55, Marko Rauhamaa wrote: bartc : The internal utilities used within an operating system, primarily intended for file or redirected i/o with no live interaction, should be distinct from those designed to be used directly with a live user. Or is it against the

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 5:47 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: >>> Personally, I think stdin is a bit lame as a stimulus source for an >>> interactive program. That's not

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 18:42, Chris Angelico wrote: On Sat, Oct 7, 2017 at 4:13 AM, bartc wrote: So what's the excuse for an unresponsive text display in 2017? Got it. You assume that a system is a coherent computer with its peripherals, rather than being a networked collection of

Re: The "loop and a half"

2017-10-06 Thread Marko Rauhamaa
Chris Angelico : > On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: >> Personally, I think stdin is a bit lame as a stimulus source for an >> interactive program. That's not even what stdin is primarily meant >> for; stdin is meant to be the input data

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: > Personally, I think stdin is a bit lame as a stimulus source for an > interactive program. That's not even what stdin is primarily meant for; > stdin is meant to be the input data for a job. Similarly, stdout is > meant to

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 17:05, Grant Edwards wrote: > On 2017-10-06, Thomas Jollans wrote: >> Seriously? sys.stdin can be None? That's terrifying. > > Why? > > Unix daemons usually run with no stdin, stderr, or stdout. That's pretty rare. Usually they are just

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Grant Edwards
On 2017-10-06, Marko Rauhamaa wrote: > The reason a daemon usually opens dummy file descriptors for the 0, 1 > and 2 slots is to avoid accidents. Some library might assume the > existence of those file descriptors. For example, I often see GTK print > out diagnositic messages.

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 15:08, Dennis Lee Bieber wrote: > On Fri, 6 Oct 2017 15:06:03 +0200, "Peter J. Holzer" > declaimed the following: > > >>I can see some merit in the idea that filters could print a short help >>message when reading from a terminal, but

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:54 AM, Grant Edwards wrote: > On 2017-10-06, Chris Angelico wrote: >> On Sat, Oct 7, 2017 at 4:05 AM, Grant Edwards >> wrote: >>> On 2017-10-06, Thomas Jollans wrote: >>>

<    1   2   3   4   5   >