0

As in the title, im using windows cmd. I know there is:

print("\n" * rows)

but it leaves cursor at the bottom of the terminal. Is there any way to clear screen when not leaving the cursor at the botom while using no modules?

rev
  • 1
  • 4
  • Easiest would be `system('cls')` but you still need to import `os` for that. Why the requirement of not using modules? – CherryDT Apr 24 '20 at 13:32
  • @CherryDT It doesn't matter, i just can't. – rev Apr 24 '20 at 13:34
  • Well it sort of matters because this sounds a lot like an [XY problem](http://xyproblem.info/). – CherryDT Apr 24 '20 at 13:43
  • @CherryDT It has nothing to do with code, it's just my goal to write a specified program without using any modules. – rev Apr 24 '20 at 13:51
  • 1
    At startup `os` should already be loaded in `sys.modules`, so you're aren't avoiding the actual import by avoiding `import os`. Moreover, most of os is defined in the builtin module `nt` on Windows or `posix` in Unix, e.g. `os.system` is actually `nt.system`. – Eryk Sun Apr 24 '20 at 16:31

0 Answers0