How do I write to a terminal using Python under linux?
For example in Ubuntu you can open two terminal, type 'tty' to get the handle. and you can pipe between them. for example you can type in one but the output get out on the other one.
So the question is...
1. how do I open a new terminal in Python and already have the handle?
2. or if I already have a terminal window open, provide this to python?
3. how to I write to terminal? including newline?
for example this:
-a person open a terminal window
-run my app
-provide the tty handle to my app
-my app ask for name
-print out "Hello name" in the terminal window.
-and provide a new line / enter
-so that I can also send 'echo 'name' to the terminal and press enter.
I'm new to python but I've been googling but can't even find a simple app that print hello world to a terminal window in linux. you know, something as simple as:
-ask for terminal tty handle
-print hello world in the terminal
is it tty? but python lib is not helping and it seems tty can be used for text files too?
I already google but either tty in python is too enriched or what I have no idea.