Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

psspy in PSSE v33 is a 32-bit pyd and it won't work if you use a 64-bit Python interpreter to run it.

There is a workaround. You can call Python 32-bit interpreter in your 64-bit interpreter.

The post is here : https://stackoverflow.com/questions/27863832/calling-python-2-script-from-python-3/42229700

But you may need to change the "Version" to the full path of your 32-bit Python.

Example:

import execnet

def call_python_version(Version, Module, Function, ArgumentList):
        gw      = execnet.makegateway("popen//python=%s" % Version)
        channel = gw.remote_exec("""
            from %s import %s as the_function
            channel.send(the_function(*channel.receive()))
        """ % (Module, Function))
        channel.send(ArgumentList)
        return channel.receive()

result = call_python_version(r"C:\Python27\python.exe", "psspy", "case",  
                                 ['<path to your SAV file>'])    
print(result)

This code should print the errorcode from psspy.case()