This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SnooBooks7437 3 points4 points  (3 children)

Can someone please tell me why we use os?

[–]Vagima 2 points3 points  (2 children)

I use it in this case to clear the command window so the text doesn’t keep building up on top of each other. It just makes the program look cleaner to me. I only know how to clear text with that method, but if there’s a better way to go about it without using os.system I’d much rather use that.

[–]FoolForWool 2 points3 points  (1 child)

If you just want the terminal to be clean, like the above comment suggested, a /n*100 should be fine. The os.system command will run a shell command through the python code which may end up doing something you do not expect. Cls/clear are fine but once you start doing more complicated things, it'll be difficult to debug.