On 22 kol, 16:01, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> On 22 ago, 10:04, [EMAIL PROTECTED] wrote:
>
>
>
> > > >> > e.g I need run my my_scripts_setup.bat that contain:
>
> > > >> > python myscript_setup.py py2exe
>
> > > >> > Can I cover or redirect log of that process into my wx program?
> > > >> > I'am using Windows XP SP2, and Python 2.5.
>
> Try the subprocess module. For the single line command you posted
> earlier, you don't even need the bat file:
>
> import subprocess
> p = subprocess.Popen(["python", "myscript_setup.py", "py2exe"],
> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
> p.wait()
> output_from_process = p.stdout.readlines()
>
> This would be fine if executing the script takes relatively a short
> time and doesn't generate so many output lines; there are other
> examples in the subprocess module documentation <http://
> docs.python.org/lib/module-subprocess.html>
>
> --
> Gabriel Genellina

Hi,

This works fine.
Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to