#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0

    Keep python script running?


    I'm writing a script for fun that runs and loops in terminal. it starts but when i click on any other open window it pauses. I want it to keep outputting data no matter what else i'm doing. Is that considered a background process?
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,894
    Rep Power
    481
    Assuming you know what you're doing, either your operating system was written for the Babbage engine or it's so advanced there's a hidden switch for "keep running in background".
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    8
    Rep Power
    0
    A more helpfull answer would have been to say throw a & at the end of: python script.py &
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,894
    Rep Power
    481

    Excuse me?


    How do we know from your initial post that you've got sh functionality?

    To understand job control in the shell you'll need to use the sh man page or man bash. Shell syntax isn't associated with some other program. And some of the functions built into the shell are not separate programs.
    man fg
    man bg
    These job control information inquiry commands won't work; neither fg nor bg are separate programs. You'll need to read man bash. Or zsh. Or ksh. Or ash. Or any of the other shells you might use and I've forgotten or never knew.

    Comments on this post

    • Cameron0960 agrees : Awesome!
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo