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 6357029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:05:10+00:00 2026-05-24T23:05:10+00:00

Within a python program I need to run a command in background, without displaying

  • 0

Within a python program I need to run a command in background, without displaying its output. Therefore I’m doing os.system("nohup " + command + " &") for now.

Edit : command shouldn’t be killed/closed when python program exits.

However that will only work on Linux, and the content of the file will end up in nohup.out but I don’t need it there. Therefore I’m looking for a platform independent solution.
os.spawnlp(os.P_DETACH, command) doesn’t work, even with the *p version so as to be able not to enter full path to application.

NB. I know that command is generally platform dependent, but that’s not the point of my question.

  • 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-05-24T23:05:11+00:00Added an answer on May 24, 2026 at 11:05 pm

    You are looking for a daemon process. Look at How do you create a daemon in Python? or http://blog.ianbicking.org/daemon-best-practices.html

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

Sidebar

Related Questions

How do I call an external command within Python as if I had typed
I need to invoke a VBA macro within an Excel workbook from a python
Within c#, I need to be able to Connect to a remote system, specifying
From within my master python program, I am spawning a child program with this
What is the easiest way to use a DLL file from within Python ?
The Python list comprehension syntax makes it easy to filter values within a comprehension.
Python gives us the ability to create 'private' methods and variables within a class
I have a third-party GUI program that I'm wrapping with a Python class (using
I need to determine whether the shell which invoked my Python script was in
I am trying to do some basic file parsing within a directory in Python

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.