First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
I want to find all the .sav files in E:\007, and conver the generators and loads use cong( ) and conl( ) function, but there are some errors in the program I wrote, anyone can help me ?
Thank you very much!
import os,sys sys.path.append(r"C:\Program Files\PTI\PSSE33\PSSBIN") os.environ['PATH'] = r"C:\Program Files\PTI\PSSE33\PSSBIN;" + os.environ['PATH'] os.chdir(r"E:\007") import psspy import redirect import glob PYTHONPATH = r'C:\Program Files\PTI\PSSE33\EXAMPLE'
sys.path.append(PYTHONPATH) os.environ['PATH'] += ';' + PYTHONPATH
redirect.psse2py()
for CASE in glob.glob(os.path.join('E:\007\','*.sav')): psspy.psseinit(150000) psspy.case(CASE)
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,2,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,3,[0,0],[0.0,0.0,0.0,0.0])
case_root = os.path.splitext(sys.argv[1])[0]
psspy.save(case_root + "_C.sav")
*Traceback (most recent call last): File "E:\007\21.py", line 32, in <module> case_root = os.path.splitext(sys.argv[1])[0] IndexError: list index out of range*
2 | No.2 Revision |
I want to find all the .sav files in E:\007, and conver the generators and loads use cong( ) and conl( ) function, but there are some errors in the program I wrote, anyone can help me ?
Thank you very much!
import os,sys
sys.path.append(r"C:\Program Files\PTI\PSSE33\PSSBIN")
os.environ['PATH'] = r"C:\Program Files\PTI\PSSE33\PSSBIN;" + os.environ['PATH']
os.chdir(r"E:\007")
import psspy
import redirect
import glob
PYTHONPATH = r'C:\Program redirect.psse2py()
There ERRORS are as follow:
*Traceback (most recent call last): File "E:\007\21.py", line 32, in <module> case_root = os.path.splitext(sys.argv[1])[0] IndexError: list index out of range*
3 | No.3 Revision |
I want to find all the .sav files in E:\007, and conver the generators and loads use cong( ) and conl( ) function, but there are some errors in the program I wrote, anyone can help me ?
Thank you very much!
import os,sys
sys.path.append(r"C:\Program Files\PTI\PSSE33\PSSBIN")
os.environ['PATH'] = r"C:\Program Files\PTI\PSSE33\PSSBIN;" + os.environ['PATH']
os.chdir(r"E:\007")
import psspy
import redirect
import glob
PYTHONPATH = r'C:\Program Files\PTI\PSSE33\EXAMPLE'
sys.path.append(PYTHONPATH)
os.environ['PATH'] += ';' + PYTHONPATH
redirect.psse2py()
for CASE in glob.glob(os.path.join('E:\\007\\','*.sav')):
psspy.psseinit(150000)
psspy.case(CASE)
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,2,[0,0],[0.0,0.0,0.0,0.0])
psspy.conl(0,1,3,[0,0],[0.0,0.0,0.0,0.0])
case_root = os.path.splitext(sys.argv[1])[0]
psspy.save(case_root + "_C.sav")
There ERRORS are as follow:
*Traceback
Traceback
(most recent call last):
File "E:\007\21.py", line 32, in <module>
case_root = os.path.splitext(sys.argv[1])[0]
IndexError: list index out of