0
How to find the length of the interpreter?
How to find the length of the interpreter? I want print a line of "—" symbols to the interpreter.
1 Resposta
+ 2
I believe, what you meant was, how to print "-" for a complete line in the terminal or wherever you are running the file, I suppose it's python.
In order to achieve this, the hint is
os.get_terminal_size()
Gives you the columns I.e. width and number of lines, we focus on the columns.
Therefore, the code is,
import os
print("-"*os.get_terminal_size().columns)