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 to pdf or jpg or png. Except

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 pr

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 the > gcc > C compiler: > >> gcc

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 avoid accidents. Some library might assume the >>

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 preprocesses the code and shows the r

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 stimulus source for an interactive program. That's no

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 acceptable in the 1970s

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 example, I often see

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 and shows the result. Typical progra

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 de

Re: callable values (was: Introducing the "for" loop)

2017-10-06 Thread Steve D'Aprano
On Sat, 7 Oct 2017 03:25 am, Stefan Ram wrote: > FWIW, in my course notes, I have coined a special word for > this: > > A /prelate/ (German: "Prälat") is a callable value (object). In English, prelate is a kind of priest, a senior clergyman and dignitary. I don't know whether German make

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-arranged a program's input

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 Objective C++, but today I > disco

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 t

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: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Christopher Reimer
On Oct 6, 2017, at 12:58 PM, Stephan Houben wrote: > > Op 2017-10-06, Christopher Reimer schreef : > >> So I got tox and tox-docker installed. When I went to install Docker >> for Windows, it wouldn't work because Hyper-V wasn't available on >> Windows 10 Home. After paying Microsoft $99 for th

Re: callable values

2017-10-06 Thread Thomas Jollans
On 06/10/17 18:25, Stefan Ram wrote: > Terry Reedy writes: >> On 10/6/2017 8:44 AM, ROGER GRAYDON CHRISTMAN wrote: >>> Despite the documentation, I would still be tempted to say that range is a >>> function. >> It is, *according* to the documentation. Built-in classes are included >> in Library

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 connectivity) and use a preloaded text editor.

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) returns true if a

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 the simplest should

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 stdout. And yes, people do write Unix daemons

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 is that 'sort' is

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. I could have used a web ser

Re: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Stephan Houben
Op 2017-10-06, Christopher Reimer schreef : > So I got tox and tox-docker installed. When I went to install Docker > for Windows, it wouldn't work because Hyper-V wasn't available on > Windows 10 Home. After paying Microsoft $99 for the privilege, I got > Windows 10 Pro installed and Docker starte

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, then, is used to >>

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 like "TENDER

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 text editor, and then

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 existing file-based s

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 coherent computer with its >> peripher

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 rules of Unix to

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 even what stdin is primarily meant >>> for; stdin is mean

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 computers, all 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 for a job. Similarly, stdout >> is mean

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 be the result of th

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 connected to /dev/null or a log file. Complet

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. I run a lot of GTK

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 creating a second >>"interactive" version of eac

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: >>> Seriously? sys.stdin can be None? That's terrifying. >>> >>> Why? >>> >>> Unix daemons usuall

Re: stop/start windows services -python command

2017-10-06 Thread Prabu T.S.
On Friday, October 6, 2017 at 4:29:48 AM UTC-4, Paul Moore wrote: > On 6 October 2017 at 04:52, Prabu T.S. wrote: > > On Thursday, October 5, 2017 at 9:00:19 PM UTC-4, MRAB wrote: > >> On 2017-10-06 01:37, Prabu T.S. wrote: > >> > On Thursday, October 5, 2017 at 8:33:02 PM UTC-4, MRAB wrote: > >>

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 15:00, Dennis Lee Bieber wrote: > On Fri, 6 Oct 2017 15:04:45 +0100, bartc declaimed the > following: >>But if I use the -S option (show assembly listing) that DOES output to a >>file (program.s). >> > > The assembler file is created anyway -- but is normally a temporary > fi

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

2017-10-06 Thread Marko Rauhamaa
Chris Angelico : > 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 stdout. >> >> And yes, people do write Unix daemons in P

Re: The "loop and a half"

2017-10-06 Thread Grant Edwards
On 2017-10-06, bartc wrote: > So what's the excuse for an unresponsive text display in 2017? Well, they've invented this thing called "networking". Not everybody in the world sits alone working with nothing other than the computer in front of them. Some people have to deal with remote systems

Re: The "loop and a half"

2017-10-06 Thread Marko Rauhamaa
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 rules of Unix to have two different versions of a > pr

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, 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 stdout. >> >> And yes, people do

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:13 AM, bartc wrote: > On 06/10/2017 15:55, Chris Angelico wrote: >> >> On Fri, Oct 6, 2017 at 11:38 PM, bartc 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

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: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 stdout. > > And yes, people do write Unix daemons in Python. Hmm, but usually I wo

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 15:55, Chris Angelico wrote: On Fri, Oct 6, 2017 at 11:38 PM, bartc 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? You absolutely have to work

Re: callable values

2017-10-06 Thread Rhodri James
On 06/10/17 17:25, Stefan Ram wrote: Terry Reedy writes: On 10/6/2017 8:44 AM, ROGER GRAYDON CHRISTMAN wrote: Despite the documentation, I would still be tempted to say that range is a function. It is, *according* to the documentation. Built-in classes are included in Library Reference, Ch.

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, Thomas Jollans wrote: > Seriously? sys.stdin can be None? That's terrifying. Why? Unix daemons usually run with no stdin, stderr, or stdout. And yes, people do write Unix daemons in Python. -- Grant Edwards grant.b.edwardsYow! VICARIOUSLY experience

Platform preferences survey (your chance to gripe about app stores!)

2017-10-06 Thread Zak Fenton
Hi everyone! I'm launching a business offering new tools and services that might be of interest to users of scripting languages, so I'm interested in hearing your input (again). Thanks to those of you who participated in the earlier survey I've been busy improving the product suite to better

Re: Introducing the "for" loop

2017-10-06 Thread Terry Reedy
On 10/6/2017 8:44 AM, ROGER GRAYDON CHRISTMAN wrote: Despite the documentation, I would still be tempted to say that range is a function. It is, *according* to the documentation. Built-in classes are included in Library Reference, Ch. 2, Built-in Functions. Changing that to "Built-in Funct

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

2017-10-06 Thread Thomas Jollans
On 2017-10-06 17:01, eryk sun wrote: > On Fri, Oct 6, 2017 at 1:31 PM, Thomas Jollans wrote: >> On 2017-10-06 12:33, 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 >>> cou

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 1:31 PM, Thomas Jollans wrote: > On 2017-10-06 12:33, 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-arran

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 11:38 PM, bartc wrote: > And is there any reason why you wouldn't use a text editor to capture your > input first? I can see myself noticing an error I'd made 10 lines up, which > is now too late to change, and I've still got 100 lines to go. What to do? As has already been

Re: The "loop and a half"

2017-10-06 Thread eryk sun
On Fri, Oct 6, 2017 at 2:35 PM, Paul Moore wrote: > > cmd: > for /f %i in ('gcc -E program.c') do ... Note that CMD processes the output as decoded Unicode text instead of encoded bytes. This is often a source of mojibake. It runs the above command with stdout redirected to a pipe, and it dec

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 13:24, bartc wrote: > On 06/10/2017 14:11, Peter J. Holzer wrote: >> On 2017-10-06 12:38, bartc wrote: >>> On 06/10/2017 12:51, Chris Angelico wrote: What you REALLY mean is that you can't see the point of an interactive sort command. It doesn't fit into your workflow. And

Re: The "loop and a half"

2017-10-06 Thread bartc
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 and shows the result. Typical programs will have many thousands of lines of

Re: The "loop and a half"

2017-10-06 Thread Thomas Jollans
On 2017-10-06 15:48, Dennis Lee Bieber wrote: > {Okay -- I've probably inspired someone to create an OS where one uses a > leading "-" to "undo" the normal action of the following command} For clarity, I think it should be +mount! and -mount! to mount and unmount, and +mount? to see what's mounted

Re: Good virtualenv and packaging tutorials for beginner?

2017-10-06 Thread Anssi Saari
Leam Hall writes: > Folks on IRC have suggested using virtualenv to test code under > different python versions. Sadly, I've not found a virtualenv tutorial > I understand. Anyone have a link to a good one? I recently used http://www.simononsoftware.com/virtualenv-tutorial-part-2/ to set up one.

Re: The "loop and a half"

2017-10-06 Thread Paul Moore
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 and shows the result. Typical programs will have > many thousands of lines of output, but it just dumps it to

Re: Introducing the "for" loop

2017-10-06 Thread Paul Moore
On 6 October 2017 at 13:44, ROGER GRAYDON CHRISTMAN wrote: > Despite the documentation, I would still be tempted to say that range is a > function. > Taking duck-typing to the meta-level, every time I use range, I use its name > followed > by a pair of parentheses enclosing one to three parameters

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 14:11, Peter J. Holzer wrote: On 2017-10-06 12:38, bartc wrote: On 06/10/2017 12:51, Chris Angelico wrote: What you REALLY mean is that you can't see the point of an interactive sort command. It doesn't fit into your workflow. And that's fine. It's not something you'd use very of

Re: newb question about @property

2017-10-06 Thread bartc
On 05/10/2017 14:13, Steve D'Aprano wrote: On Thu, 5 Oct 2017 10:51 pm, bartc wrote: Am I allowed to say that it all seems a bit of a mess? You may or may not be pleased to learn that there's a push to create a "record like" or "struct like" datatype for Python 3.7 or 3.8, tentatively called

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

2017-10-06 Thread Paul Moore
On 6 October 2017 at 13:22, Steve D'Aprano wrote: >> Yep. My real beef with ls is multi-column vs single-column. >> Paul > > You don't think multiple columns in interactive mode is useful? I'm surprised, > because I find it invaluable. Interactively, I use ls -l 99.9% of the time. When I use raw

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 12:38, bartc wrote: > On 06/10/2017 12:51, Chris Angelico wrote: > > What you REALLY mean is that you can't see the point of an interactive > > sort command. It doesn't fit into your workflow. And that's fine. It's > > not something you'd use very often. There are other programs, how

Re: Pedagogical style [was Re: The "loop and a half"]

2017-10-06 Thread Neil Cerutti
On 2017-10-05, Steve D'Aprano wrote: > In fairness to Stefan, we should also include iteration and > assignment as concepts being learned, but in this case they are > directly connected to the immediate problem rather than at best > only indirectly, and distantly, related. Teaching the iteration

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 11:41, bartc wrote: > On 06/10/2017 12:04, Rhodri James wrote: >> On 05/10/17 19:45, bartc wrote: >>> Yes, I tried typing 'sort' in Linux, where it apparently hangs (same >>> on Windows actually). The reason: because it might have killed someone >>> to have added a message saying w

Re: Pedagogical style [was Re: The "loop and a half"]

2017-10-06 Thread ROGER GRAYDON CHRISTMAN
On Thu, Oct 5, 2017 8:18 PM, Ben Bacarisse wrote: > Steve D'Aprano writes: > >> There's no link to the original paper, only to secondary sources that discuss >> it, e.g.: >> >> http://phys.org/pdf128266927.pdf > > >> [1] Anecdotes are not data, but for what it is worth, just in the last two >> d

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:45, Chris Angelico wrote: On Fri, Oct 6, 2017 at 9:32 PM, bartc wrote: (And properly, by being given the same of an actual file rather than using crude redirection.) Why do you call redirection "crude"? Do you not understand the value of generic solutions that work with all p

Re: OT I before E [was Re: Lies in education [was Re: The "loop and a half"]]

2017-10-06 Thread CFK
On Oct 5, 2017 2:02 PM, "Roel Schroeven" wrote: Thomas Jollans schreef op 5/10/2017 10:30: On 2017-10-05 06:47, Steve D'Aprano wrote: > >> On Thu, 5 Oct 2017 02:54 pm, Chris Angelico wrote: >> >>> (There are exceptions even to the longer form of the rule, but only a >>> handful. English isn't a

Re: Introducing the "for" loop

2017-10-06 Thread ROGER GRAYDON CHRISTMAN
On Thu, Oct 5, 2017 7:45 PM, breamore...@gmail.com wrote: > On Friday, October 6, 2017 at 2:05:58 AM UTC+1, Irv Kalb wrote: >> >> The range function is discussed after that. >> > >FWIW range isn't a function in Python 3. From https://docs.python.org/3/library/functions.html#func-range "Rathe

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:51, Chris Angelico wrote: On Fri, Oct 6, 2017 at 10:41 PM, bartc wrote: > What you REALLY mean is that you can't see the point of an interactive > sort command. It doesn't fit into your workflow. And that's fine. It's > not something you'd use very often. There are other progr

Re: How to determine lowest version of Python 3 to run?

2017-10-06 Thread Christopher Reimer
On Oct 5, 2017, at 3:34 PM, Christopher Reimer wrote: > >> On Oct 5, 2017, at 1:11 PM, Irmen de Jong wrote: >> >>> On 10/05/2017 04:23 AM, Christopher Reimer wrote: >>> >>> I'm leaning towards installing the latest minor version of each available >>> major version, running tox to run the uni

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

2017-10-06 Thread Thomas Jollans
On 2017-10-06 12:33, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Fri, Oct 6, 2017 at 7:09 PM, Steve D'Aprano >> wrote: >>> What are the right ways for a Python script to detect these sorts of >>> situations? >>> >>> (1) Standard input is coming from a pipe; >>> >>> (2) Stdin is being r

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

2017-10-06 Thread Steve D'Aprano
On Fri, 6 Oct 2017 11:11 pm, Paul Moore wrote: > On 6 October 2017 at 12:42, Chris Angelico wrote: >> Generally, you should not have to worry about the behaviour of a >> program being drastically different if you append "| cat" to the >> command line. Which means you don't want TOO much differenc

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

2017-10-06 Thread Paul Moore
On 6 October 2017 at 12:42, Chris Angelico wrote: > Generally, you should not have to worry about the behaviour of a > program being drastically different if you append "| cat" to the > command line. Which means you don't want TOO much difference between > interactive mode and non-interactive mode

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 10:41 PM, bartc wrote: > On 06/10/2017 12:04, Rhodri James wrote: >> >> On 05/10/17 19:45, bartc wrote: >>> >>> Yes, I tried typing 'sort' in Linux, where it apparently hangs (same on >>> Windows actually). The reason: because it might have killed someone to have >>> added a

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 9:32 PM, bartc wrote: > (And properly, by being given the same of an actual file rather than using > crude redirection.) Why do you call redirection "crude"? Do you not understand the value of generic solutions that work with all programs, rather than having every program i

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:04, Rhodri James wrote: On 05/10/17 19:45, bartc wrote: Yes, I tried typing 'sort' in Linux, where it apparently hangs (same on Windows actually). The reason: because it might have killed someone to have added a message saying what you are expected to type and how to end it. (

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

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 8:27 PM, Paul Moore wrote: > On 6 October 2017 at 10:14, Marko Rauhamaa wrote: >> Generally, you shouldn't condition the program too much on such >> environmental details, although it is done. For example, the "ls" >> command outputs the directory listing in a (colorful) mu

Re: why does memory consumption keep growing?

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 8:05 PM, D'Arcy Cain wrote: > On 10/05/2017 05:42 PM, Fetchinson . via Python-list wrote: >> >> On 10/5/17, Chris Angelico wrote: >>> >>> On Fri, Oct 6, 2017 at 8:06 AM, Fetchinson . via Python-list >>> wrote: import mystuff mystuff.some_more_expen

Re: The "loop and a half"

2017-10-06 Thread Rhodri James
On 05/10/17 19:45, bartc wrote: Yes, I tried typing 'sort' in Linux, where it apparently hangs (same on Windows actually). The reason: because it might have killed someone to have added a message saying what you are expected to type and how to end it. (Namely, press Ctrl-D start at the start of

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 9:48 AM, Paul Moore wrote: > On 6 October 2017 at 09:36, Peter J. Holzer wrote: >> On 2017-10-06 08:09, Steve D'Aprano wrote: >> >>> # 1 detect input coming from a pipe. >>> import sys >>> import os >>> from stat import S_ISFIFO >>> if S_ISFIFO(os.fstat(0).st_mode): >>>

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

2017-10-06 Thread Steve D'Aprano
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-arranged a program's input so > that some non-zero input f

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

2017-10-06 Thread Ben Bacarisse
Chris Angelico writes: > On Fri, Oct 6, 2017 at 7:09 PM, Steve D'Aprano > wrote: >> What are the right ways for a Python script to detect these sorts of >> situations? >> >> (1) Standard input is coming from a pipe; >> >> (2) Stdin is being read from a file; >> >> (3) Stdin is coming from a huma

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 02:07, Steve D'Aprano wrote: On Fri, 6 Oct 2017 09:57 am, Marko Rauhamaa wrote: Waiting for input isn't "hangs". That's an ignorant and foolish thing to say, more suited for a wet-behind-the-ears newbie than somebody who claims to be a long-time old-school programmer. That's wh

Re: stop/start windows services -python command

2017-10-06 Thread alister via Python-list
On Thu, 05 Oct 2017 17:37:11 -0700, Prabu T.S. wrote: > On Thursday, October 5, 2017 at 8:33:02 PM UTC-4, MRAB wrote: >> On 2017-10-05 23:32, Prabu T.S. wrote: >> > On Thursday, October 5, 2017 at 6:16:44 PM UTC-4, Prabu T.S. wrote: >> >> hello all,what is the command to stop and start windows ser

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

2017-10-06 Thread Paul Moore
On 6 October 2017 at 10:14, Marko Rauhamaa wrote: > Generally, you shouldn't condition the program too much on such > environmental details, although it is done. For example, the "ls" > command outputs the directory listing in a (colorful) multi-column > format when stdout is a terminal and in a (

Re: Suggestions on storing, caching, querying json

2017-10-06 Thread Sayth Renshaw
On Thursday, 5 October 2017 15:13:43 UTC+11, Sayth Renshaw wrote: > HI > > Looking for suggestions around json libraries. with Python. I am looking for > suggestions around a long term solution to store and query json documents > across many files. > > I will be accessing an api and downloadin

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

2017-10-06 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Oct 6, 2017 at 7:09 PM, Steve D'Aprano > wrote: >> What are the right ways for a Python script to detect these sorts of >> situations? >> >> (1) Standard input is coming from a pipe; >> (2) Stdin is being read from a file; >> (3) Stdin is coming from a human at a termin

Re: why does memory consumption keep growing?

2017-10-06 Thread D'Arcy Cain
On 10/05/2017 05:42 PM, Fetchinson . via Python-list wrote: On 10/5/17, Chris Angelico wrote: On Fri, Oct 6, 2017 at 8:06 AM, Fetchinson . via Python-list wrote: import mystuff mystuff.some_more_expensive_stuff( x ) del mystuff del x You're not actually deleting anything.

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

2017-10-06 Thread Paul Moore
On 6 October 2017 at 09:36, Peter J. Holzer wrote: > On 2017-10-06 08:09, Steve D'Aprano wrote: >> What are the right ways for a Python script to detect these sorts of >> situations? >> >> (1) Standard input is coming from a pipe; >> >> (2) Stdin is being read from a file; >> >> (3) Stdin is comi

Re: why does memory consumption keep growing?

2017-10-06 Thread Paul Moore
On 6 October 2017 at 06:51, Chris Angelico wrote: > Cloud computing is the answer. > > If you don't believe me, just watch the sky for a while - new clouds > get added without the sky turning off and on again. The sky reboots every 24 hours, and the maintenance window's about 8-12 hours. Not exac

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 08:09, Steve D'Aprano wrote: > What are the right ways for a Python script to detect these sorts of > situations? > > (1) Standard input is coming from a pipe; > > (2) Stdin is being read from a file; > > (3) Stdin is coming from a human at a terminal; > > I get these. How did I do?

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

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 7:09 PM, Steve D'Aprano wrote: > What are the right ways for a Python script to detect these sorts of > situations? > > (1) Standard input is coming from a pipe; > > (2) Stdin is being read from a file; > > (3) Stdin is coming from a human at a terminal; > > I get these. How

Re: stop/start windows services -python command

2017-10-06 Thread Paul Moore
On 6 October 2017 at 04:52, Prabu T.S. wrote: > On Thursday, October 5, 2017 at 9:00:19 PM UTC-4, MRAB wrote: >> On 2017-10-06 01:37, Prabu T.S. wrote: >> > On Thursday, October 5, 2017 at 8:33:02 PM UTC-4, MRAB wrote: >> >> On 2017-10-05 23:32, Prabu T.S. wrote: >> >> > On Thursday, October 5, 20

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

2017-10-06 Thread Steve D'Aprano
On Fri, 6 Oct 2017 12:37 pm, Ben Bacarisse wrote: >> But in fairness, if the author of the `sort` command had a commitment to >> friendliness in their programs, they could have `sort` only print a message >> when it is reading from stdin and writing to stdout, > > I think you mean "when reading f

Re: why does memory consumption keep growing?

2017-10-06 Thread Peter Otten
Chris Angelico wrote: > On Fri, Oct 6, 2017 at 4:14 PM, Gregory Ewing > wrote: >> Steve D'Aprano wrote: >>> >>> Plus the downtime and labour needed to install the memory, if the >>> computer will even take it. >> >> >> Obviously we need an architecture that supports hot-swappable >> robot-install

Re: problem with Python 3.6 + PyX

2017-10-06 Thread skysign
Please install below. in my case, it is resolved. sudo apt install texinfo sudo apt install texlive-binaries 2017년 2월 11일 토요일 오전 8시 49분 36초 UTC+9, stalker5 님의 말: > Yes, I have a Tex engine on my system. > How can i fix the problem with the PATH ? > Even if i execute the .py script directly by pyt

  1   2   >