Is there a way to close PowerFactory from unattended mode?


There is a way of closing the PowerFactory application in Python without closing the Python

In this case you can open PowerFactory by using „app = powerfactory.GetApplicationExt()“ and later on just with “del app” PowerFactory will be removed


import sys


import powerfactory

# start PowerFactory

app = powerfactory.GetApplicationExt()


# ... do something with PowerFactory

# shutdown PowerFactory

del app

 # ... do something without PowerFactory

print('PowerFactory is closed but Python script is still alive')


When PowerFactory was started by a Python script from external and the application object is deleted then PowerFactory is terminated but the current process keeps running. In this situation, it is not possible to start PowerFactory again in the same process.