Line wrapping in the interactive shell is not controlled by Python. It
is controlled by your terminal or console.
It is possible that the terminal may have a setting to disable wrapping
at the end of each line, but that would be pretty annoying for most
common uses of the terminal, so I doubt it. (If you are a system
administrator working in a shell, you probably don’t want critical
information from commands being hidden off the side of the terminal.)
If you are writing Python code, you can work out the width of the
terminal and then truncate each line:
from os import get_terminal_size
width = get_terminal_size()
for line in lines:
You might try an advanced shell like Jupiter or IPython, it may have an
option to enable and disable line wrapping, but I doubt it.