Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread shawn bright
cool, thanks again sk On Fri, May 29, 2009 at 5:09 PM, Alan Gauld wrote: > > "vince spicer" wrote >> >> import commands >> output = commands.getout("ls -lah") > > There are many ways to do this in Python including os.popen, commands and > subprocess. > > But subprocess is the "officially correct

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread Alan Gauld
"vince spicer" wrote import commands output = commands.getout("ls -lah") There are many ways to do this in Python including os.popen, commands and subprocess. But subprocess is the "officially correct" version, the others are deprecated and could theoretically disappear in a future ver

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread shawn bright
kick butt, gents, thanks a lot sk On Fri, May 29, 2009 at 4:39 PM, W W wrote: > On Fri, May 29, 2009 at 4:27 PM, shawn bright wrote: >> >> Hey all >> >> I have a small program that when run from the command line, will >> return a certain value for an arguement. Like this: >> >> > mfetchz 45 >> >

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread W W
On Fri, May 29, 2009 at 4:27 PM, shawn bright wrote: > Hey all > > I have a small program that when run from the command line, will > return a certain value for an arguement. Like this: > > > mfetchz 45 > > 45j > > so the program is mfetchz and the argument is 45 > > i know i can call the program

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread vince spicer
Sorry *output import commands > output = commands.getoutput("ls -lah") > Vince > > > On Fri, May 29, 2009 at 3:27 PM, shawn bright wrote: > >> Hey all >> >> I have a small program that when run from the command line, will >> return a certain value for an arguement. Like this: >> >> > mfetchz 4

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread vince spicer
import commands output = commands.getout("ls -lah") Vince On Fri, May 29, 2009 at 3:27 PM, shawn bright wrote: > Hey all > > I have a small program that when run from the command line, will > return a certain value for an arguement. Like this: > > > mfetchz 45 > > 45j > > so the program is mfet

[Tutor] how to get variable from an external script or program

2009-05-29 Thread shawn bright
Hey all I have a small program that when run from the command line, will return a certain value for an arguement. Like this: > mfetchz 45 > 45j so the program is mfetchz and the argument is 45 i know i can call the program with os.system("mfetchz 45") but how do i get the return? The OS is lin