Deutsch   English   Français   Italiano  
<wwvy1612j5b.fsf@LkoBDZeT.terraraq.uk>

View for Bookmarking (what is this?)
Look up another Usenet article

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 <invalid@invalid.invalid>
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: <wwvy1612j5b.fsf@LkoBDZeT.terraraq.uk>
References: <v71fcn$ah31$1@dont-email.me>
	<memo.20240714223824.14216Q@jgd.cix.co.uk>
	<v71tga$cpvf$1@dont-email.me>
	<slrnv9cmi1.5oqr.rotflol2@geidiprime.bvh>
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<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
     F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
     +r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
Bytes: 3275
Lines: 41

Borax Man <rotflol2@hotmail.com> writes:
> On 2024-07-15, Lawrence D'Oliveiro <ldo@nz.invalid> 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/