152
all 18 comments
sorted by: hot top controversial new old
[-] DahGangalang@infosec.pub 44 points 2 years ago

So I love that this meme is detailed enough to have the older guy's arm partially block his name tag.

...but I'm disappointed that, in spite of such details elsewhere, there's a misspelt word.

The dichotomy is making my bones itch.

[-] MajorHavoc@lemmy.world 25 points 2 years ago

It dosent have any mispelings.

[-] DahGangalang@infosec.pub 11 points 2 years ago

But feal there maey be a does of misspelt words in your setnence thoungh

[-] MajorHavoc@lemmy.world 5 points 2 years ago

That mite bee! I will cheque!

[-] replicat@lemmy.world 6 points 2 years ago

I'm pretty sure OP speaks English as a second language.

[-] oo1@kbin.social 33 points 2 years ago

stackoverflow vs posting a meme.

Which one gets the best help?

I can see the appeal of the meme option.

[-] einfach_orangensaft@feddit.de 23 points 2 years 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

[-] BeigeAgenda@lemmy.ca 15 points 2 years ago

My first thought was, can you flush the buffer?

[-] 2xsaiko@discuss.tchncs.de 13 points 2 years 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 2 years ago

thank you!

tmux did thr tick for me

[-] programmer_belch@lemmy.dbzer0.com 10 points 2 years ago

Just guessing here but could it be because you haven't set up correctly pt2 as stdin for pt3, try to invoke the command as

script.py 
[-] ook_the_librarian@lemmy.world 4 points 2 years ago

This is because the "tty" (by which I mean the device named by the output of ´tty´) is only displaying what is sent to it. Be it from the keyboard or pty2.

The fact that the keyboard also fills an input buffer from python has to do with how python and the keyboard are attached to the same input file device which is a separate thing from them having same output file device.

If anything that could output to tty2 could inject inputs to something using tty2 as an input buffer, that would be a security nightmare.

Now, I'll sit back and let Cunningham's law kick in.

[-] mvirts@lemmy.world 3 points 2 years ago* (last edited 2 years ago)

With the correct permission you should be able to write straight into pythons stdin from /proc like

Cat whatever > /proc/$pythonpid/fd/0

[-] marcos@lemmy.world 3 points 2 years ago

Named pipes are your friends. Or sockets.

[-] navigatron@beehaw.org 3 points 2 years ago

Time to dive into the wide world of VTTYs. I believe you’re writing to pts3’s output buffer - writing to its input buffer is a different virtual device / may be a process descriptor, I’m not sure. Look into the history of vttys and it should start to make sense.

this post was submitted on 09 Dec 2023
152 points (87.6% liked)

Programmer Humor

37475 readers
92 users here now

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

Rules:

founded 6 years ago
MODERATORS