First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
2018-08-31 02:04:02 -0500 | received badge | ● Famous Question (source) |
2018-04-18 09:00:25 -0500 | received badge | ● Notable Question (source) |
2018-04-12 10:02:30 -0500 | received badge | ● Popular Question (source) |
2018-04-10 11:26:59 -0500 | received badge | ● Editor (source) |
2018-04-10 11:21:06 -0500 | asked a question | I have a python code works for PSSE32 I want it for PSSE33, what should I change in this code? Here is the first lines, I think I need something to do with glade (GUI) at the middle of the code. |
2018-04-10 11:13:41 -0500 | asked a question | I have a code works with PSSE32 but I want it to work with PSSE33, what should I need to change? I have both 32 and 33 on my system. I changed all PSSE32 words to PSSE33 throughout code. I think something related to GUI (glade) need to change as well. Here is first lines of the code import gtk from gtk import * import gtk.glade from gtk.glade import * import os import gtk.gdk import string import time import shutil import pango RootPath = "D:\personal\ThreeWTool\" result = os.path.exists(RootPath) PSSE_Path = "D:\Progra~1\PTI\PSSE33" MustPath = "D:\Program Files\PTI\MUST 10.2\Program" import sys,copy,winsound if not os.path.exists('C:\Program Files (x86)\PTI\PSSE33\'): os.listdir('C:\Program Files (x86)\PTI\PSSE33\PSSBIN') sys.path.append('C:\Program Files (x86)\PTI\PSSE33\PSSBIN') sys.path.append('C:\Program Files (x86)\PTI\PSSE33\PSSLIB') sys.path.append('C:\GTK\lib') os.environ['PATH'] += ';C:\Program Files (x86)\PTI\PSSE33\PSSLIB' os.environ['PATH'] += ';C:\Program Files (x86)\PTI\PSSE33\PSSBIN' os.environ['PATH'] += ';C:\GTK\lib' else: os.listdir('C:\Program Files (x86)\PTI\PSSE33\PSSBIN') sys.path.append('C:\Program Files (x86)\PTI\PSSE33\PSSBIN') sys.path.append('C:\Program Files (x86)\PTI\PSSE33\PSSLIB') sys.path.append('C:\GTK\lib') os.environ['PATH'] += ';C:\Program Files (x86)\PTI\PSSE33\PSSLIB' os.environ['PATH'] += ';C:\Program Files (x86)\PTI\PSSE33\PSSBIN' os.environ['PATH'] += ';C:\GTK\lib' import psspy i,f=psspy.getbatdefaults() ierr=psspy.psseinit(100000) class ProfileClass: def init(self): pass def CWD(filename): # current working directory length = len(filename) k = length while k: k -=1 if filename[k] == '/' or filename[k] == '\': break try: os.chdir(filename[:k]) except: os.chdir(RootPath) class Application: def init(self): self.xml = gtk.glade.XML("glade/3WTool.glade") nameFuncMap = {} for key in dir(self.class): nameFuncMap[key] = getattr(self,key) self.xml.signal_autoconnect(nameFuncMap) self.Load() gtk.main() PSSE_Path=eachline[8]Must_Path=eachline[9] contents.append(PSSE_Path+"\n")contents.append(Must_Path+"\n") |