0

enter image description here

i was using the following code to clear my terminal:

import os
import sys
clear=lambda:os.system('cls')
clear()

but instead of clearing the terminal, it output a question mark. Why? and how do i actually clear the terminal. Using python 3.9

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Gaenox L
  • 9
  • 2
  • You can find your answer in [clear-terminal-in-python](https://stackoverflow.com/questions/2084508/clear-terminal-in-python). – Hook Mar 29 '21 at 20:26
  • What do you get when you try some other CMD commands (`dir` for example)? Do they work as expected? If you try a garbage command do you get the standard `'aaaa' is not recognized as an internal or external command...`? – General Grievance Mar 29 '21 at 20:37

1 Answers1

0

Try using cmd. This command should only work for the normal terminal.

fadop3
  • 21
  • 4