Re: [Tutor] finding difference in time

2009-05-15 Thread Martin Walsh
Kent Johnson wrote: > On Fri, May 15, 2009 at 12:46 AM, R K wrote: >> Gurus, >> >> I'm trying to write a fairly simple script that finds the number of hours / >> minutes / seconds between now and the next Friday at 1:30AM. >> >> I have a few little chunks of code but I can't seem to get everything

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 t

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 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 > IAmAnEmptyFileWith

Re: [Tutor] finding difference in time

2009-05-15 Thread Dave Angel
R K wrote: Gurus, I'm trying to write a fairly simple script that finds the number of hours / minutes / seconds between now and the next Friday at 1:30AM. I have a few little chunks of code but I can't seem to get everything to piece together nicely. import datetime,time now = datetime.dat

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 > IAmAnEmptyFileWith

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

2009-05-15 Thread Sander Sweers
2009/5/15 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 > IAmAnE

Re: [Tutor] finding difference in time

2009-05-15 Thread Kent Johnson
On Fri, May 15, 2009 at 12:46 AM, R K wrote: > Gurus, > > I'm trying to write a fairly simple script that finds the number of hours / > minutes / seconds between now and the next Friday at 1:30AM. > > I have a few little chunks of code but I can't seem to get everything to > piece together nicely.

[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 http://m

[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" u

Re: [Tutor] finding difference in time

2009-05-15 Thread Andre Engels
On Fri, May 15, 2009 at 6:46 AM, R K wrote: > Gurus, > > I'm trying to write a fairly simple script that finds the number of hours / > minutes / seconds between now and the next Friday at 1:30AM. > > I have a few little chunks of code but I can't seem to get everything to > piece together nicely.