Skip to main content
added 294 characters in body
Source Link
user845459
user845459

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Edit/Update :

usingLet's say I have a small python application with frontend which has various functions. I have a RUN command which runs python scripts in background .I want to implement a PAUSE feature which would pause the running python script . When the user commands RUN again then the python script should resume running . using raw_input() or print() needs you to forceforces user to issue command.But in this case, we don't know when user want to interrupt and pause or issue/pause/issue a command.So usual input/print is not usable.

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Edit/Update :

using raw_input() or print() needs you to force user to issue command.But in this case, we don't know when user want to interrupt and pause or issue a command.So usual input/print is not usable.

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Edit/Update :

Let's say I have a small python application with frontend which has various functions. I have a RUN command which runs python scripts in background .I want to implement a PAUSE feature which would pause the running python script . When the user commands RUN again then the python script should resume running . using raw_input() or print() forces user to issue command.But in this case, we don't know when user want to interrupt/pause/issue a command.So usual input/print is not usable.

added 219 characters in body
Source Link
user845459
user845459

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Edit/Update :

using raw_input() or print() needs you to force user to issue command.But in this case, we don't know when user want to interrupt and pause or issue a command.So usual input/print is not usable.

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?

Edit/Update :

using raw_input() or print() needs you to force user to issue command.But in this case, we don't know when user want to interrupt and pause or issue a command.So usual input/print is not usable.

Source Link
user845459
user845459

pause/resume a python script in middle

Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?

There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want my main program be able to respond to user pause/resume command for the running script.Should I define a thread? Whats the approach ?