Ask Your Question

Running "Compile" and "Cload4" from python

asked 2014-08-14 21:20:16 -0500

Hitech gravatar image

Hi, Everyone

I am wondering if anyone have worked out how to run "Compile" and "Cload4" from python with pss/e 32. I understand there is environment manager that can be used but I am trying to automate entire dynamic study run including these commands. I used to use batch file with Pss/e 29 and it was working fine but I am migrating all my scripts to python thinking it would be efficient.

I have tried using "subprocess" module to pass commands to "cmd" prompt but it does not quite work.

import sys,os,subprocess

def open_app():
    q=subprocess.Popen([r"C:\Program Files (x86)\PTI\PSSE32\SET_PSSE_PATH.BAT"],shell=True)

The above code set path for pss/e and works fine upto "dir/b" command but does not recognize "psse" as a command.

It would be great if someone can help me with this part of the code and bridge the gap in my dynamic study automation.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-12-07 11:44:47 -0500

GaryB gravatar image

Try this:

import subprocess

runstr = r'"C:\Windows\SysWOW64\cmd.exe" /k '\
    r'"C:\Program Files (x86)\PTI\PSSE32\SET_PSSE_PATH.BAT"'\
    r'& compile.bat'

def open_app():
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2014-08-14 21:20:16 -0500

Seen: 2,189 times

Last updated: Dec 07 '20