Sujet : Re: IDLE: clearing the screen
De : michael.stemper (at) *nospam* gmail.com (Michael F. Stemper)
Groupes : comp.lang.pythonDate : 10. Jun 2024, 16:49:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v477am$h1qk$2@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 10/06/2024 09.32, Stefan Ram wrote:
"Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
On 08/06/2024 14.18, Rob Cliffe wrote:
OK, here is the advanced version:
import os
class _cls(object):
def __repr__(self):
os.system('cls')
return ''
cls = _cls()
...
Why have it return anything at all?
Because __repr__ needs to return a str.
Got it. Thanks for clarifying.
-- Michael F. Stemper87.3% of all statistics are made up by the person giving them.