152
you are viewing a single comment's thread
view the rest of the comments
[-] einfach_orangensaft@feddit.de 23 points 1 year ago

Context:

I have 2 Terminals open, in one is a Python Terminal Chat client running(pt3). I want to sent text from the other terminal(pt2) to the chat. It does write the text to pt3 but pt3 dosent 'see' the text.

If i send over "hallo world" it prints on the terminal but dosent show up in chat.

github of the python termina terminal chat

[-] 2xsaiko@discuss.tchncs.de 13 points 1 year ago

A PTS is a single character device. Writing to it causes output to appear on the terminal buffer, reading from it reads from the input buffer. So, writing to it like you do from a separate shell effectively does the same as calling print() from python which has it as inherited stdio. There is a way to write to a PTS input buffer but it's not straightforward and works in a completely different way. Use something like tmux instead, or better, sockets.

[-] einfach_orangensaft@feddit.de 4 points 1 year ago

thank you!

tmux did thr tick for me

load more comments (6 replies)
this post was submitted on 09 Dec 2023
152 points (87.6% liked)

Programmer Humor

34259 readers
32 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS