Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-18 Thread Lie Ryan
Alan Gauld wrote: "MK" wrote Seems that i did it the wrong way still from the beginning. I did it now with open and write an empty file. But anyway i would wish to know if it is possible to terminate a running cat. It depends on what you mean by a running cat. Of course it meant "a runn

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-15 Thread Steve Willoughby
On Fri, May 15, 2009 at 08:51:26AM -0700, Steve Willoughby wrote: > On Fri, May 15, 2009 at 04:18:16PM +0100, Alan Gauld wrote: > > echo ^D | cat > foo > > > > sends a CtrlD to cat which writes an empty file to foo. > > And since this seems to be a point of confusion for you, And that was actual

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-15 Thread Steve Willoughby
On Fri, May 15, 2009 at 04:18:16PM +0100, Alan Gauld wrote: > echo ^D | cat > foo > > sends a CtrlD to cat which writes an empty file to foo. And since this seems to be a point of confusion for you, keep in mind that the ^D character itself is not a "command" or even seen by the cat program at al

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-15 Thread Alan Gauld
"MK" wrote Seems that i did it the wrong way still from the beginning. I did it now with open and write an empty file. But anyway i would wish to know if it is possible to terminate a running cat. It depends on what you mean by a running cat. cat simply concatenates (ie joins) its input t

Re: [Tutor] Python popen command using cat > textfile .... how toterminate

2009-05-14 Thread Alan Gauld
"vince spicer" wrote Take a peak at commands.getoutput Or more "correctly" look at the subprocess module. All previous mechanisms for process control are rendered obsolete and are deprecated in favour of subprocess So if we aren't using popen lets at least use subprocess. It is slightly mo