Score:0

Shell script that runs python script again when it's finished

co flag

I want to create a sh script that runs python script python core.py and when the script is finished pause for some milliseconds and run it again. And so on and on. Not sure where to start - any help appreciated.

co flag
I am not sure Watch waits for the python script to complete, so maybe not
hr flag
Note that although the minimum time unit in GNU `sleep` is the second, it does permit fractional values ex. `0.0xy` for xy milliseconds. So you can use a simple `while ... sleep` loop as in [this answer](https://askubuntu.com/a/1254081/178692)
co flag
Yes but it says nothing about the command being complete before running again. I can not guess the sleep time, it will vary much.
BeastOfCaerbannog avatar
ca flag
@JohnT As mentioned in the answers of [this U&L question](https://unix.stackexchange.com/questions/403537/what-happens-in-watch-when-the-called-command-has-not-yet-finished), `wacth` waits until the command is finished before running it again after the specified time interval.
co flag
Great! I will test it ASAP and get back here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.