Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-17 Thread Walker Hale IV
On Fri, May 15, 2009 at 12:46 PM, Noufal Ibrahim nou...@nibrahim.net.in wrote: MK wrote: Hi there, i am using this code to send an cat ThisIsMyUrl with popen. Of cos cat now waits for the CTRL+D command. How can i send this command ? Wouldn't it be better if you directly opened the

[Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread MK
Ok. I explain it once more. Its not about reading the console output of the command. Its that i want to put a empty file in my subdirectories so that the name of the file is a message or url or something else. And if you want an empty file you can do that with cat IAmAnEmptyFileWithOnlyAName

[Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread MK
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. Thank you all. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread Sander Sweers
2009/5/15 MK lop...@gmx.net: Ok. I explain it once more. Its not about reading the console output of the command. Its that i want to put a empty file in my subdirectories so that the name of the file is a message or url or something else. And if you want an empty file you can do that with cat

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread A.T.Hofkamp
MK wrote: Ok. I explain it once more. Its not about reading the console output of the command. Its that i want to put a empty file in my subdirectories so that the name of the file is a message or url or something else. And if you want an empty file you can do that with cat

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread Lie Ryan
MK wrote: Ok. I explain it once more. Its not about reading the console output of the command. Its that i want to put a empty file in my subdirectories so that the name of the file is a message or url or something else. And if you want an empty file you can do that with cat

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-15 Thread Noufal Ibrahim
MK wrote: Hi there, i am using this code to send an cat ThisIsMyUrl with popen. Of cos cat now waits for the CTRL+D command. How can i send this command ? Wouldn't it be better if you directly opened the ThisIsMyUrl file and wrote the text into it rather than rely on shelling out for this?

[Tutor] Python popen command using cat textfile .... how to terminate

2009-05-14 Thread MK
Hi there, i am using this code to send an cat ThisIsMyUrl with popen. Of cos cat now waits for the CTRL+D command. How can i send this command ? def console_command(cmd): print cmd console = os.popen(cmd,r) output = console.read() console.close() return

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-14 Thread vince spicer
Take a peak at commands.getoutput EX: import commmands ls = commands.getoutput(ls- ls) Vince On Thu, May 14, 2009 at 3:50 PM, MK lop...@gmx.net wrote: Hi there, i am using this code to send an cat ThisIsMyUrl with popen. Of cos cat now waits for the CTRL+D command. How can i send this

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-14 Thread Martin Walsh
MK wrote: Hi there, i am using this code to send an cat ThisIsMyUrl with popen. Of cos cat now waits for the CTRL+D command. How can i send this command ? def console_command(cmd): print cmd console = os.popen(cmd,r) output = console.read() console.close()

Re: [Tutor] Python popen command using cat textfile .... how to terminate

2009-05-14 Thread Sander Sweers
Forwarding to list because of mail delivery error... 2009/5/15 Sander Sweers sander.swe...@gmail.com: 2009/5/14 MK lop...@gmx.net: i am using this code to send an cat ThisIsMyUrl with popen. First, I am not sure if you understand what cat ThisIsMyUrl actually does... It waits for data on