importtimeMAX_SIZE=10BUFFER=[""foriinrange(MAX_SIZE)]I=0defprint_buffer():globalBUFFERprint('\x1bc')print("\n".join(BUFFER))defpush_update(message):globalBUFFERglobalIifI==MAX_SIZE:I=0BUFFER[I]=messageI+=1print_buffer()foriinrange(1,200):push_update("Hello World %s"%i)time.sleep(1)
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.