Hi !
I have a py2exe compiled wx application in Windows.
I call shell commands in my module with this function:
def Cmd(cmd,LogProc,tmpdir=PrgPath):
outfn='%s/_out.msg'%tmpdir
errfn='%s/_err.msg'%tmpdir
post="1>%s 2>%s"%(outfn,errfn)
cmd2='%s %s'%(cmd,post)
try:
LogProc("Command: %s"%cmd2)
cmd2=Decode(cmd2)
r=os.system(cmd2)
except:
typ,val,tra=sys.exc_info()
excmsg="\n".join(traceback.format_exception(typ,val,tra))
return(-1,excmsg)
f=open(outfn,"r")
try:
s1=f.read()
finally:
f.close()
f=open(errfn,"r")
try:
s2=f.read()
finally:
f.close()
s="\n".join([s1,s2]).strip()
os.remove(outfn)
os.remove(errfn)
return (r,s)
Results are catched, and I can get every information: the process result code, and result messages too.
Result code is interesting, because if not 0, I can do anything else. And messages in any computers are not same - but this code is equal everytime.
Result messages stored in log, for better error catching, and for mail reporting.
This is working on a server machine. But I want to do same thing in a client.
So I created and compiled a wx wrapper, a simple log shower (progress) window.
But !
In this mode the every command open a shell window while working, and that is very ugly !
Can anyone helps me ? I want to hide these windows, or prevent the showing of them.
Thanks for advance: dd