Path: ...!news.mixmin.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail From: Richard Kettlewell Newsgroups: comp.os.linux.misc Subject: Re: What programs do you make sure are installed on a new Linux Date: Tue, 16 Jul 2024 21:09:52 +0100 Organization: terraraq NNTP server Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6"; logging-data="39000"; mail-complaints-to="usenet@innmantic.terraraq.uk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:Wxj4ELkGs6Dlk/8s3M6lqZ0UQ7o= X-Face: h[Hh-7npe<v9!1Z&W?r\c.!4DXH5PWpga"ha +r0NzP?vnz:e/knOY)PI- X-Boydie: NO Bytes: 3275 Lines: 41 Borax Man writes: > On 2024-07-15, Lawrence D'Oliveiro wrote: >> On Sun, 14 Jul 2024 22:38 +0100 (BST), John Dallman wrote: >>> ldo@nz.invalid (Lawrence D'Oliveiro) wrote: >>>> But it is fundamental in Windows, is it not, that every process has >>>> a GUI. Unless it is a _service_, which runs in the background, and >>>> is managed separately. >>> >>> No, it is not. "Console applications" run with stdin, stdout & stderr, >>> rather like traditional Unix programs. They can also have character >>> graphics UIs, in terminal windows. >> >> So why do Python scripts, for example, have to come in two varieties on >> Windows, with different extensions “.PY” versus “.PYW”? > > Windows definately does do "console" applications. What is missing, is > the ability to run a console application without the GUI running itself, > but the standard C "Hello world" program does run on Windows I’m not sure what you mean by “the GUI running itself”. Windows executables either use the CUI (console) or GUI subsystem, and this is represented by a field in the PE file header, rather than being a behavior of the application after it starts. CUI subsystem applications always run within a console, either inherited from the parent process, or created automatically if there isn’t one to inherit. GUI subsystem applications don’t normally get one (but can create one). Presumably a GUI subsystem application doesn’t have to open any Window at all if it doesn’t want to. In Python the .py vs .pyw distinction presumably allows file associations to a CUI subsystem version of the interpreter and a GUI subsystem version of the interpreter. References: * https://devblogs.microsoft.com/oldnewthing/20090101-00/?p=19643 * https://learn.microsoft.com/en-us/windows/console/creation-of-a-console * https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header32 -- https://www.greenend.org.uk/rjk/