my vs code python terminal wont refresh itself automatically and to run the same code again i have to close the terminal and run the program again.
is there any extension or shortcut which may help me?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
You can append the following lines to the end of your code.
This runs the
clear
command on the terminal and clears your terminal screen, which seems to be what your expectation is.Make sure to import the module
os
Place at the top of the script the import statement
Then, place this line of code where you want the terminal clearing (clear) to happen
PS: you can also use
os.system('clear')
as suggested in the previous answer.