Using Python, I would like to print a line that will appear on the last visible line on the console the script is being ran from. For example, something like this:
Would this be able to be done?
The easiest way is to use effbot.org's Console
module:
import Console
c = Console.getconsole()
c.text(0, -1, 'And this is the string at the bottom of the console')
By specifying -1
for the second (line) argument you are addressing the last line of the console.
Because the Console
module only works on Windows, to get this to work on UNIX terminals as well, you should take a look at the wcurses
library, which provides a partial curses
implementation that'll work on Windows. You'd drive it the same as the stdlib curses
module; use the first on Windows, the latter on UNIX.
For a Windows terminal try the console module For unix the curses module would do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With