Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Reed O'Brien
On Dec 26, 2008, at 8:57, "Emad Nawfal (عماد نوفل)" mail.com> wrote: 2008/12/26 Kent Johnson On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) wrote: > suppose I have an external program that prints "testing the subprocess > module" > I know I can run it through the commands module

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Alan Gauld
"Emad Nawfal (عماد نوفل)" wrote proc = subprocess.Popen('python3.0 hello.py', shell=True, stdout=subprocess.PIPE, ) stdout_value = proc.communicate()[0] Thank you Kent. It works, but isn't the commands module much simpler? I

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Emad Nawfal (عماد نوفل)
2008/12/26 Kent Johnson > On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) > wrote: > > suppose I have an external program that prints "testing the subprocess > > module" > > I know I can run it through the commands module like this: > > > a = commands.getoutput("python3.0 hello.py"

Re: [Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Kent Johnson
On Fri, Dec 26, 2008 at 8:09 AM, Emad Nawfal (عماد نوفل) wrote: > suppose I have an external program that prints "testing the subprocess > module" > I know I can run it through the commands module like this: > a = commands.getoutput("python3.0 hello.py") a > 'testing the subprocess modul

[Tutor] commands versus subprocess, I'm confused

2008-12-26 Thread Emad Nawfal (عماد نوفل)
Hello Tutors, and Happy New Year and Holidays, suppose I have an external program that prints "testing the subprocess module" I know I can run it through the commands module like this: >>> a = commands.getoutput("python3.0 hello.py") >>> a 'testing the subprocess module' >>> len(a) 29 >>> b = a.sp