问题
I am new to Python scripting and I am currently trying to get acquainted with python scripting and DigSILENT Powerfactory.
I have managed thus far to execute powerfactory, activate projects and execute a load flow but after my code ends, when I try to rerun it, it wont run. In order for it to run I need to close Spyder and reopen it. I believe this is related to the fact that powerfactory is still running in the background so I was wondering if there is any command that "forces" powerfactory to shut down after the code execution.
Any tip would be greatly appreciated :)
回答1:
I had the same problem. But faster than shutdown/reopen spyder is to restart the kernel with ctrl + .
回答2:
you could try this:
app.PostCommand("exit")
来源:https://stackoverflow.com/questions/42582399/how-can-i-exit-powerfactory-using-python-in-unattended-mode