"Mike Tammerman" <[EMAIL PROTECTED]> writes: > Yes, it throws exceptions if I build the exe of the subprogram.py. > > So, is it possible to pipe some data to another py2exe'd application > without a console.
I did this just some days ago. It required a little bit of experimenting. This code executes the Windows XP ftp.exe console program (but doesn't show a console), and reads its output. Here is the relevant code snippet: from subprocess import Popen, PIPE, STDOUT # It seems subprocess doesn't open a console by default # when run from a windows program # # Plus: For whatever reason, when running as py2exe'd GUI # program, stdin=None doesn't work. We HAVE to specify PIPE for stdin, # and we HAVE to use '... < NUL', and then stdin.close(). p = Popen("ftp.exe -s:upload.txt %s < NUL" % self._address, cwd=os.path.join(util.get_main_dir(), "blah"), shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT ) p.stdin.close() text = "" while 1: data = p.stdout.readline() if not data: break <handle output data> if p.wait(): <handle error> return The problem was that passing 'stdin=None' didn't work, for whatever reason. I don't think it is a py2exe problem although the comment above may suggest it. Hope that helps, Thomas -- http://mail.python.org/mailman/listinfo/python-list