Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
einfach_orangensaft ( einfach_orangensaft@feddit.de )  to Programmer Humor@lemmy.ml · 3 years ago

it writes to output to the terminal or it gets the SIGTERM again

feddit.de

message-square
9
link
fedilink
100

it writes to output to the terminal or it gets the SIGTERM again

feddit.de

einfach_orangensaft ( einfach_orangensaft@feddit.de )  to Programmer Humor@lemmy.ml · 3 years ago
message-square
9
link
fedilink
alert-triangle
You must log in or # to comment.
  • DahGangalang ( DahGangalang@infosec.pub ) 
    link
    fedilink
    arrow-up
    31
    ·
    3 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.

  • oo1 ( oo1@kbin.social ) 
    link
    fedilink
    arrow-up
    26
    ·
    3 years ago

    stackoverflow vs posting a meme.

    Which one gets the best help?

    I can see the appeal of the meme option.

  • einfach_orangensaft ( einfach_orangensaft@feddit.de ) OP
    link
    fedilink
    arrow-up
    18
    ·
    3 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 ( BeigeAgenda@lemmy.ca ) 
      link
      fedilink
      arrow-up
      11
      ·
      3 years ago

      My first thought was, can you flush the buffer?

    • Programmer Belch ( programmer_belch@lemmy.dbzer0.com ) 
      link
      fedilink
      English
      arrow-up
      10
      ·
      3 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 
    • dblsaiko ( 2xsaiko@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      8
      ·
      3 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 ( einfach_orangensaft@feddit.de ) OP
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        thank you!

        tmux did thr tick for me

    • navigatron ( navigatron@beehaw.org ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 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.

  • DeepGradientAscent ( DeepGradientAscent@programming.dev ) Banned
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    3 years ago

    Removed by mod

    • Bob ( MadBob@feddit.nl ) 
      link
      fedilink
      arrow-up
      7
      ·
      3 years ago

      In your haste to correct it to “doesn’t” you missed “why does it doesn’t”.

      • DeepGradientAscent ( DeepGradientAscent@programming.dev ) Banned
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        3 years ago

        Removed by mod

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 41 users / week
  • 303 users / month
  • 1.81K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.3K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) 
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code