This is my first post so please tell me if there is anything I do wrongly or can change to improve upon my posts ;).
So I'm a programmer beginner, mainly doing school projects. Lately I've been exploring python on my own for a bit. I made a program that can automatically test if coupon codes for a certain site are valid coupons (I know this is a questionable thing to do, and did it for sheer curiosity). Anyway my program prints for every coupon code whether it is valid, and print the valid coupons to a different text file.
As my program prints out for every code if it is valid I get a lot of lines in the terminal as output. The valid codes are coloured green using ANSI sequences.
My question is if it is possible to keep all the valid codes on top of the terminal, while it is still searching for new codes? It would be really nice if only one line remained that shows what the program is doing, while it clears all the invalid printed coupon codes and keeps all the printed lines for the valid ones.
Anyway I'm not sure if this is possible at all, but I'm quite curious.
Looking forward to any answers, and I'd like to thank everyone in advance!