[Tutor] find() doesnt work as expected

2010-01-01 Thread MK
At first, happy new year to all of you. I am trying to write a little script which uses one file as input and looks if the string from this file are in target file. And if not prints out that line/string so that i know which strings must be added to complete the target file. The format of the targ

Re: [Tutor] print IP address range to stdout

2009-12-23 Thread MK
Am Dienstag, den 22.12.2009, 19:09 +0100 schrieb spir: > MK dixit: > > > First function the ip is splitted as i did it. Alright. > > The use 256 as it is the maximum for any digit. ok. > > But what is

Re: [Tutor] print IP address range to stdout

2009-12-22 Thread MK
for exp in [3,2,1,0]: octet = octet + str(intip / (256 ** exp)) + "." intip = intip % ( 256 ** exp) return (octet.rstrip(".")) Am Dienstag, den 22.12.2009, 06:32 -0500 schrieb Dave Angel: > > MK wrote: > > Hi there, > > > >

[Tutor] print IP address range to stdout

2009-12-22 Thread MK
Hi there, i have some logical problem. I dont get it done to write my for loops in that way that the ip address range which is given as arguments are correct processed. Meaning that only the ips are printed which the user defines as argument. I tried to make an if statement to stop at the end_adre

[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

[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() ret