Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Intel CPUs are not defective, they just act that way. -- Henry Spencer


devel / comp.lang.python / Re: Temporally disabling buffering

SubjectAuthor
* Temporally disabling bufferingCecil Westerhof
+* Re: Temporally disabling bufferingMarco Sulla
|`- Re: Temporally disabling bufferingCecil Westerhof
`* Re: Temporally disabling bufferingBarry
 `- Re: Temporally disabling bufferingCecil Westerhof

1
Temporally disabling buffering

<87wngajtx2.fsf@munus.decebal.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22072&group=comp.lang.python#22072

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Cecil@decebal.nl (Cecil Westerhof)
Newsgroups: comp.lang.python
Subject: Temporally disabling buffering
Date: Thu, 31 Mar 2022 12:30:33 +0200
Organization: Decebal Computing
Lines: 15
Message-ID: <87wngajtx2.fsf@munus.decebal.nl>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="764ee7aaa65c227d58d764c11f2686e5";
logging-data="7606"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OAU50JQDrhcPVDB1aQA0Hkz1L/Tp2VxI="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:CDGIZ1wzqXx86yOJ5n5Z9+mXMD4=
sha1:iAkS5LOsQySIO3mPaG+lPZTA96w=
 by: Cecil Westerhof - Thu, 31 Mar 2022 10:30 UTC

In Python when the output of a script is going to a pipe stdout is
buffered. When sending output to tee that is very inconvenient.

We can set PYTHONUNBUFFERED, but then stdout is always unbuffered.

On Linux we can do:
PYTHONUNBUFFERED=T script.py | tee script.log

Now the output is only unbuffered for the current run and buffered for
other runs where the output goes to a pipe.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Temporally disabling buffering

<mailman.7.1648746182.20749.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22076&group=comp.lang.python#22076

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Marco.Sulla.Python@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Re: Temporally disabling buffering
Date: Thu, 31 Mar 2022 19:02:23 +0200
Lines: 22
Message-ID: <mailman.7.1648746182.20749.python-list@python.org>
References: <87wngajtx2.fsf@munus.decebal.nl>
<CABbU2U-Op2t09tB4i+a-4xTC+xedRjffZ99mh_du=iQazF5AVg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de d9gZHaUpL9YZN8BlxlSOIQkJ+SpD4kjlM/ztMCAoP5TQ==
Return-Path: <elbarbun@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=pWP3xiSw;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'engineer': 0.02; '2022':
0.05; 'mar': 0.07; 'cc:addr:python-list': 0.09; 'linux': 0.09;
'cc:no real name:2**0': 0.14; 'url:mailman': 0.15;
'from:name:marco sulla': 0.16; 'pipe': 0.16; 'stdout': 0.16;
'wrote:': 0.16; 'python': 0.16; 'thu,': 0.19;
'cc:addr:python.org': 0.20; 'run': 0.23; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25;
'output': 0.28; 'goes': 0.28; 'url-ip:188/8': 0.31; 'python-list':
0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'script':
0.33; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'runs': 0.35; 'from:addr:gmail.com': 0.35; 'received:209.85':
0.37; 'url-ip:13.107/16': 0.38; 'received:209': 0.39; 'sending':
0.39; 'linkedin:': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=ep2FYwSTTLKab5SdtjjxNL3RWLcqn9sKV8zBZA43dNI=;
b=pWP3xiSwPmtJfXMbR1ZpzNBpsQNZ36RCLlc+QdL9Fs5+FOhdxGXcMCy2gkUUZ8Dvuk
1KsW2Prwzn/39ET5P4d0GiS0/QjsDVt3TsPe7Cfqzp4ggdf/SD1fJyMlQUz+ppfirkf/
PCVluU1+8H0nyFHyxpWde8eJvUui5MSlmN44zKPa2zuHBphbCHTtbJ879F6tek/0aHAw
pJ4CLloQM3Zp7RAIaCG9zLj20QvaXW30DWbfE7GGdBlN3vQBLFy/nGjjGaKdabgBMoUf
x/FUSJLh4SSgrfc+HK/nCJ/1uU9oUsUjImhzg39XO/jFZa0Sp1l+PoFFU0BHiOLweleo
uw2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=ep2FYwSTTLKab5SdtjjxNL3RWLcqn9sKV8zBZA43dNI=;
b=OLvdS/zosEkYjRQEQC79FqAyzGc3l1ESDhUWdkkkzd+94oplxHb/KXCkAV5vCvN2rT
Dj2CHzvf9mYS7o59k1adLgx2L5jatXSdpfuTAiS85aoKUicxVcUDZqTkAgsw7z2YXC/8
2kzSkYxMk4lEFTv9agTB9aaTWcttFi4vivnyrYMY+gb4w+nKD6VpeCQiNmk0aqY2wRGV
FRYn61byEAHgqRI3MZsCls+CMcmfHnd7h7JVkCvx/9gm6KuRppiffef+2N5wmNmAp1Ju
0GC1B+eBDhNw64xQ0UdJFk1lZfOl041Ss3YlaqbXjUUvVe76JNwJSBi2pt9AGL9GFGBt
O0Dg==
X-Gm-Message-State: AOAM531BS97J72z8v1b9FxvoJIp3T8vlTinQ3//VUwpeM7UNrXt5+X2p
Sgdr7Js8qEziYwm+aVI0/x/WV0k4xMtWSzPuqtSI7F0x
X-Google-Smtp-Source: ABdhPJz9qlAf4ALGpGtnujAeSER1FCwA7RA73XADle/GyuyjnZh88zM+rwXJEiRXuMHpfk3HZcucHB+8dsEwC93zlPI=
X-Received: by 2002:a81:652:0:b0:2e9:d3be:2f29 with SMTP id
79-20020a810652000000b002e9d3be2f29mr5921736ywg.249.1648746180141; Thu, 31
Mar 2022 10:03:00 -0700 (PDT)
In-Reply-To: <87wngajtx2.fsf@munus.decebal.nl>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CABbU2U-Op2t09tB4i+a-4xTC+xedRjffZ99mh_du=iQazF5AVg@mail.gmail.com>
X-Mailman-Original-References: <87wngajtx2.fsf@munus.decebal.nl>
 by: Marco Sulla - Thu, 31 Mar 2022 17:02 UTC

Dirty suggestion: stderr?

On Thu, 31 Mar 2022 at 18:38, Cecil Westerhof via Python-list
<python-list@python.org> wrote:
>
> In Python when the output of a script is going to a pipe stdout is
> buffered. When sending output to tee that is very inconvenient.
>
> We can set PYTHONUNBUFFERED, but then stdout is always unbuffered.
>
> On Linux we can do:
> PYTHONUNBUFFERED=T script.py | tee script.log
>
> Now the output is only unbuffered for the current run and buffered for
> other runs where the output goes to a pipe.
>
> --
> Cecil Westerhof
> Senior Software Engineer
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
> --
> https://mail.python.org/mailman/listinfo/python-list

Re: Temporally disabling buffering

<mailman.8.1648747432.20749.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22077&group=comp.lang.python#22077

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: Temporally disabling buffering
Date: Thu, 31 Mar 2022 18:23:40 +0100
Lines: 34
Message-ID: <mailman.8.1648747432.20749.python-list@python.org>
References: <87wngajtx2.fsf@munus.decebal.nl>
<0DFC5C72-4849-44B6-9DC9-C8BD9C855943@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de DqvKD4idweZuzbfNbaB1Hw4puJSR//sZ5wBQzOXN6p9Q==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'engineer': 0.02; 'mar':
0.07; 'cc:addr:python-list': 0.09; 'from:addr:barry': 0.09;
'linux': 0.09; 'received:217.70': 0.09; 'received:217.70.178':
0.09; 'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'cc:no real name:2**0': 0.14; 'url:mailman': 0.15; '2022,': 0.16;
'barry': 0.16; 'from:addr:barrys-emacs.org': 0.16; 'message-id
:@barrys-emacs.org': 0.16; 'pipe': 0.16; 'stdout': 0.16;
'windows.': 0.16; 'wrote:': 0.16; 'python': 0.16;
'cc:addr:python.org': 0.20; 'run': 0.23; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25;
'output': 0.28; 'goes': 0.28; 'url-ip:188/8': 0.31; 'python-list':
0.32; 'but': 0.32; 'script': 0.33; 'header:In-Reply-To:1': 0.34;
'runs': 0.35; 'url-ip:13.107/16': 0.38; 'sending': 0.39; 'use':
0.39; 'received:217': 0.67; 'linkedin:': 0.84
In-Reply-To: <87wngajtx2.fsf@munus.decebal.nl>
X-Mailer: iPad Mail (19E241)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <0DFC5C72-4849-44B6-9DC9-C8BD9C855943@barrys-emacs.org>
X-Mailman-Original-References: <87wngajtx2.fsf@munus.decebal.nl>
 by: Barry - Thu, 31 Mar 2022 17:23 UTC

> On 31 Mar 2022, at 17:39, Cecil Westerhof via Python-list <python-list@python.org> wrote:
>
> In Python when the output of a script is going to a pipe stdout is
> buffered. When sending output to tee that is very inconvenient.
>
> We can set PYTHONUNBUFFERED, but then stdout is always unbuffered.
>
> On Linux we can do:
> PYTHONUNBUFFERED=T script.py | tee script.log
>
> Now the output is only unbuffered for the current run and buffered for
> other runs where the output goes to a pipe.

I prefer to use the -u when I run the output of python into the.

python -u script.py | tee script.log

And use py -u on windows.

Barry

>
> --
> Cecil Westerhof
> Senior Software Engineer
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Re: Temporally disabling buffering

<87a6d2jxda.fsf@munus.decebal.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22104&group=comp.lang.python#22104

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Cecil@decebal.nl (Cecil Westerhof)
Newsgroups: comp.lang.python
Subject: Re: Temporally disabling buffering
Date: Sun, 03 Apr 2022 12:05:05 +0200
Organization: Decebal Computing
Lines: 32
Message-ID: <87a6d2jxda.fsf@munus.decebal.nl>
References: <87wngajtx2.fsf@munus.decebal.nl>
<0DFC5C72-4849-44B6-9DC9-C8BD9C855943@barrys-emacs.org>
<mailman.8.1648747432.20749.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="7a442fac58e84ed78bd132f44d1698f9";
logging-data="8788"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GLmOUWJnNDzfab5ZR+J2F1a8dnEOL3NM="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:sLtdIJltjGu5zFCc9fuugHS7XsQ=
sha1:BQMeqAXmbtD6ZOhaz+FWyP0AKkM=
 by: Cecil Westerhof - Sun, 3 Apr 2022 10:05 UTC

Barry <barry@barrys-emacs.org> writes:

>> On 31 Mar 2022, at 17:39, Cecil Westerhof via Python-list <python-list@python.org> wrote:
>>
>> In Python when the output of a script is going to a pipe stdout is
>> buffered. When sending output to tee that is very inconvenient.
>>
>> We can set PYTHONUNBUFFERED, but then stdout is always unbuffered.
>>
>> On Linux we can do:
>> PYTHONUNBUFFERED=T script.py | tee script.log
>>
>> Now the output is only unbuffered for the current run and buffered for
>> other runs where the output goes to a pipe.
>
> I prefer to use the -u when I run the output of python into the.
>
> python -u script.py | tee script.log

Nothing wrong with that, but I find my solution more clear.
(I also use long options instead of short ones. With df I use the
option --human-readable instead of the option -h.)

> And use py -u on windows.

Luckily I almost never have to work with Windows. ;-)

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Re: Temporally disabling buffering

<87ee2ejxjy.fsf@munus.decebal.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22105&group=comp.lang.python#22105

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Cecil@decebal.nl (Cecil Westerhof)
Newsgroups: comp.lang.python
Subject: Re: Temporally disabling buffering
Date: Sun, 03 Apr 2022 12:01:05 +0200
Organization: Decebal Computing
Lines: 33
Message-ID: <87ee2ejxjy.fsf@munus.decebal.nl>
References: <87wngajtx2.fsf@munus.decebal.nl>
<CABbU2U-Op2t09tB4i+a-4xTC+xedRjffZ99mh_du=iQazF5AVg@mail.gmail.com>
<mailman.7.1648746182.20749.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="7a442fac58e84ed78bd132f44d1698f9";
logging-data="8788"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sHdRbLC5G4rGcGnhhkKh0zZaTQotu1qc="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:PjHlSoqOLrNFoGjpFEqlebAZiaY=
sha1:KCrFzDY/kWNlLqBX2AdqMx12q8M=
 by: Cecil Westerhof - Sun, 3 Apr 2022 10:01 UTC

Marco Sulla <Marco.Sulla.Python@gmail.com> writes:

> Dirty suggestion: stderr?

First: you have the same problem.
Second: as the name says, it is used for errors.

> On Thu, 31 Mar 2022 at 18:38, Cecil Westerhof via Python-list
> <python-list@python.org> wrote:
>>
>> In Python when the output of a script is going to a pipe stdout is
>> buffered. When sending output to tee that is very inconvenient.
>>
>> We can set PYTHONUNBUFFERED, but then stdout is always unbuffered.
>>
>> On Linux we can do:
>> PYTHONUNBUFFERED=T script.py | tee script.log
>>
>> Now the output is only unbuffered for the current run and buffered for
>> other runs where the output goes to a pipe.
>>
>> --
>> Cecil Westerhof
>> Senior Software Engineer
>> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>> --
>> https://mail.python.org/mailman/listinfo/python-list

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


devel / comp.lang.python / Re: Temporally disabling buffering

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor