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.

29th Apr 2021, 4:52 PM
Operand
Operand - avatar
1 Respuesta
+ 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)
29th Apr 2021, 5:03 PM
Arun Bhattacharya
Arun Bhattacharya - avatar