We know that both python and Stata have the stop-process capability, but it seems impossible to do that through pystata. For example, suppose we run the following code:
Code:
import stata_setup
stata_setup.config("C:/Program Files/Stata17", "mp")
from pystata import stata
stata.run('''
foreach i of numlist 1/4 {
disp `i'
sleep 1000
}
disp "End"
''')
And in the middle, we understand it is taking too long. Stopping the process through python does not work (I'm using Spyder IDE) and waits for the whole process to complete. Here is the video:
https://imgur.com/x92sRco
The other bug is that the rest of the python code becomes unstoppable when the stop is hit! because the stop has been hit once. For example, suppose we have the following code
Code:
import stata_setup
stata_setup.config("C:/Program Files/Stata17", "mp")
from pystata import stata
for i in range(10**3):
stata.run('''
sleep 1000
''')
print("end")
Suppose we are in loop number 100 we understand this is taking a long time, and we hit stop. It does not stop; everything gets greyed out, and even the python can't be stopped. Many other unpredictable issues sometimes occur as well when ctrl+c is hit. For example, in this video:
https://imgur.com/a/pr8BGgp
0 Response to Is there any way to stop pyStata while running?
Post a Comment