Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #31: cellular telephone interference


comp / comp.lang.python / Re: Fwd: IDLE: clearing the screen

SubjectAuthor
o Re: Fwd: IDLE: clearing the screenRob Cliffe

1
Subject: Re: Fwd: IDLE: clearing the screen
From: Rob Cliffe
Newsgroups: comp.lang.python
Date: Wed, 5 Jun 2024 22:16 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rob.cliffe@btinternet.com (Rob Cliffe)
Newsgroups: comp.lang.python
Subject: Re: Fwd: IDLE: clearing the screen
Date: Wed, 5 Jun 2024 23:16:13 +0100
Lines: 27
Message-ID: <mailman.92.1717625777.2909.python-list@python.org>
References: <0b2a163c-6e83-4739-960d-35a038d4ff0b@btinternet.com>
<Zl/W6bLq8zkT9pKj@cskk.homeip.net>
<2267f36e-bdd5-4089-921e-4664421d5bbd@btinternet.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de +sfTgxRvtCMQ08E+CtBORwgV7dGGPyMR93X0EpHbHxvQ==
Cancel-Lock: sha1:l2rwC4hL4ejWAmQUjR8rOHbB8PY= sha256:4J7VUyq51GuHBGUG2K0iO9gK3HvCap/N5vrNKWqS+cE=
Return-Path: <rob.cliffe@btinternet.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=btinternet.com header.i=@btinternet.com header.b=oRkukbzN;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.015
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'def': 0.04; 'containing':
0.05; 'expression': 0.09; 'idle': 0.09; 'prints': 0.09; 'skip:x
10': 0.09; 'subject:IDLE': 0.09; 'import': 0.15; 'cameron': 0.16;
'ide,': 0.16; 'right.': 0.16; 'simpson': 0.16; 'subject:screen':
0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20; 'returns':
0.22; 'subject:Fwd': 0.26; "isn't": 0.27; 'function': 0.27;
'header:User-Agent:1': 0.30; 'fine.': 0.32; 'to:name:python':
0.32; 'received:192.168.1': 0.32; 'header:In-Reply-To:1': 0.34;
'yes,': 0.35; "it's": 0.37; 'received:192.168': 0.37; 'prompt':
0.39; 'ide': 0.40; 'received:213': 0.40; 'whenever': 0.40;
'should': 0.40; 'skip:o 10': 0.61; 'skip:\xc2 10': 0.62; 'clear':
0.64; 'your': 0.64; 'top': 0.65; 'result,': 0.69; '8bit%:100':
0.76; 'extra': 0.84; 'rob': 0.84; 'so:': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com;
s=btmx201904; t=1717625774;
bh=ga1bwopGQXFDjyDfO4iajmZAveB+pKqO9QipwF2ry+o=;
h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To;
b=oRkukbzNJ5yU+g+AfVuWoPcdjtRD7VrOSI3ZYiBmJsE15kzE3Ex+EXvVJroMmwEQmBFux7AJh3r+YekQpO/G6pyJOehJ84+lmPaFnsI5KqhN2ELcg3QZSego7CVxklG5k9c+krK5SlhJIhdCBrZLgphOET2kUxZCZk5w3K1Z5uEYuiZXvLZ/OqItTT6YoB03NYLK1dHEmfDQgk4DDFxdyvntY+zSKDdBdCk9m/33uUmTBZlGCWLcXFAW1MtupwAoDU/TUxiDvl7aZ4lVMkpIcRBhxyi63ZHTsej5pnfWSrssAHPRl0UqzeTAuc899LpSU7odB2hz336v92p7z3/PrQ==
Authentication-Results: btinternet.com;
auth=pass (PLAIN) smtp.auth=rob.cliffe@btinternet.com;
bimi=skipped
X-SNCR-Rigid: 6577B9C5142C10EE
X-Originating-IP: [86.184.143.52]
X-OWM-Source-IP: 86.184.143.52
X-OWM-Env-Sender: rob.cliffe@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrvdeljedgtdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptfhosgcuvehlihhffhgvuceorhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepteetueffteffgeetffehveehjeduffekleetudevkeetkeehteevudejgeekheevnecukfhppeekiedrudekgedrudegfedrhedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddvtdekngdpihhnvghtpeekiedrudekgedrudegfedrhedvpdhmrghilhhfrhhomheprhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehphihthhhonhdqlhhishhtsehphihthhhonhdrohhrghdprhgvvhfkrfephhhoshhtkeeiqddukeegqddugeefqdehvddrrhgrnhhgvgekiedqudekgedrsghttggvnhhtrhgrlhhplhhushdrtghomhdprghuthhhpghushgvrheprhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomhdpghgvohfkrfepifeupdfovfetjfhoshhtpehrvgdqphhrugdqrhhgohhuthdqtddthe
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-SNCR-hdrdom: btinternet.com
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <Zl/W6bLq8zkT9pKj@cskk.homeip.net>
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: <2267f36e-bdd5-4089-921e-4664421d5bbd@btinternet.com>
X-Mailman-Original-References: <0b2a163c-6e83-4739-960d-35a038d4ff0b@btinternet.com>
<Zl/W6bLq8zkT9pKj@cskk.homeip.net>
View all headers

On 05/06/2024 04:09, Cameron Simpson wrote:
> On 04Jun2024 22:43, Rob Cliffe <rob.cliffe@btinternet.com> wrote:
>> import os
>> def cls(): x=os.system("cls")
>>
>> Now whenever you type
>> cls()
>> it will clear the screen and show the prompt at the top of the screen.
>>
>> (The reason for the "x=" is: os.system returns a result, in this case
>> 0.  When you evaluate an expression in the IDE, the IDE prints the
>> result.  So without the "x=" you get an extra line at the top of the
>> screen containing "0".)
>
> Not if it's in a function, because the IDLE prints the result if it
> isn't None, and your function returns None. So:
>
>     def cls():
>         os.system("cls")
>
> should be just fine.

Yes, you're right.
Rob Cliffe

1

rocksolid light 0.9.8
clearnet tor