Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7931579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:45:40+00:00 2026-06-03T20:45:40+00:00

I wrote a simple script using python-daemon which prints to sys.stdout : #!/usr/bin/env python

  • 0

I wrote a simple script using python-daemon which prints to sys.stdout:

#!/usr/bin/env python
#-*- coding: utf-8 -*-

import daemon
import sys
import time


def main():
    with daemon.DaemonContext(stdout=sys.stdout):
        while True:
            print "matt daemon!!"
            time.sleep(3)


if __name__ == '__main__':
    main()

The script works as I would hope, except for one major flaw–it interrupts my input when I’m typing in my shell:

(daemon)modocache $ git clomatt daemon!!
matt daemon!!ne
matt daemon!! https://github.com/schacon/cowsay.git
(daemon)modocache $ 

Is there any way for the output to be displayed in a non-intrusive way? I’m hoping for something like:

(daemon)modocache $ git clo
matt daemon!! # <- displayed on new line
(daemon)modocache $ git clo # <- what I had typed so far is displayed on a new line

Please excuse me if this is a silly question, I’m not too familiar with how shells work in general.

Edit: Clarification

The reason I would like this script to run daemonized is that I want to provide updates to the shell user from within the shell, such as printing weather updates to the console in a non-intrusive way. If there is a better way to accomplish this, please let me know. But the purpose is to display information from within the terminal (not via, say, Growl notifications), without blocking.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:45:42+00:00Added an answer on June 3, 2026 at 8:45 pm

    If it doesn’t need to be an “instant” notification, and you can wait until the next time the user runs a command, you can bake all kinds of things into your bash shell prompt. Mine tells me the time and the git repository status for the directory I’m in, for example.

    The shell variable for “normal user” shell prompts is PS1, so Googling for bash PS1 or bash prompt customisation will get you some interesting examples.

    Here’s some links:

    • Some basic customisations
    • A more complex example: git bash prompt

    In general, you can include the output of any arbitrary script in the prompt string. Be aware, however, that high-latency commands will delay printing of the prompt string until they can be evaluated, so it may be a good idea to cache information. (For example, if you want to display the weather from a weather website, don’t make your bash prompt go out and retrieve the webpage every time the prompt is displayed!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I wrote a Python script which does some simple stuff. It was originally
I wrote a simple python script using the SocketServer, it works well on Windows,
I coded a relatively simple script using python and also wrote doc strings for
I am trying to compile a simple script I wrote using Python3 and PyQt4
I wrote python script for dropping tables in all Django apps. (using settings.INSTALLED_APP) https://gist.github.com/1520683
I wrote a simple script that is intended to do hierarchical clustering on a
A couple of weeks ago, I wrote a simple Ruby script to test a
I want to write a very simple script , which takes a process name
I am trying to write a simple piece of Jquery in which the script
I wrote a very short program that parses a program using python and converts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.