Many times our output doesn’t get fit into the terminal of default size. In that case we have to pull it accordingly and make the size as per our need.
Image: Akshay Chauhan on Unsplash
In this article, I’ll show you those few lines of Python code using which you can get the size of your terminal programmatically.
Now, before resizing our output we need to know, how to read the terminal size. There are possibly many ways to get the terminal size, i.e. reading environment variables, making low level system calls, etc.
In this article, I’ll show you one of the easiest and simplest way to get the terminal size.
You can also watch the video recording of this article on my YouTube channel named Shweta Lodha.
Comments
Post a Comment