Reputation: 23
I developed an algorithm that was made to run in the foreground (with several beautiful and elegant prints) but realized that most of the time it will run in the background.
Unfortunately I did a task that runs every x time to check the size of the terminal and to do some calculations and print the results efficiently. And since this task consumes a bit of processing, when my script was in the background, I'd like to disable it.
Is there any way to know if the program was started to run in the background or foreground in python?
Upvotes: 1
Views: 521