IDLE: clearing the screen
Michael F. Stemper
michael.stemper at gmail.com
Mon Jun 10 11:49:42 EDT 2024
On 10/06/2024 09.32, Stefan Ram wrote:
> "Michael F. Stemper" <michael.stemper at 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. Stemper
87.3% of all statistics are made up by the person giving them.
More information about the Python-list
mailing list