Re: [Tutor] t = (1, *(2, 3))

2009-05-15 Thread Stefan Behnel
Jabin Jezreel wrote: I am not allowed to do t = (1, *(2, 3)) But I am allowed to do def ts(*t): ...return t ... ts(1, *(2, 3)) (1, 2, 3) I realize I can do (1,) + (2,3) (1, 2, 3) What is the rationale behind not having t = (1, *(2, 3)) have the same semantics as the ts case

Re: [Tutor] finding difference in time

2009-05-15 Thread Andre Engels
On Fri, May 15, 2009 at 6:46 AM, R K wolf85boy2...@yahoo.com 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

[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] finding difference in time

2009-05-15 Thread Kent Johnson
On Fri, May 15, 2009 at 12:46 AM, R K wolf85boy2...@yahoo.com 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

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 toterminate

2009-05-15 Thread Alan Gauld
MK lop...@gmx.net 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

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 all.

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 actually

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?

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 wolf85boy2...@yahoo.com 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