April 3rd, 2005, 12:20 PM
Okay I am making a program that uses alot of IO transfer
At the moment I need to read 3 lines of data to be read by the program at a time.
I have no clue how to do it.
Please help me
April 3rd, 2005, 12:48 PM
April 3rd, 2005, 04:08 PM
Okay heres the example
Originally Posted by †Yegg†
Only the start_up_definition matters ant the Ids filw which is equal to a txt.
I need to read 3 or 2 depending on the situation.
April 3rd, 2005, 04:53 PM
Firstly I suggest that with files that small you cut and past the text into your post, rather than attach it as a zip. Currently the reader has to download the file, open it with a zip program, and then open the file in a viewer to read it. Many of the people who would otherwise offer advice may decide it is too much hassle and go on to the next post. If you do paste it into your post, make sure you surround it with [ code ] [ /code ] tags (minus the spaces) to preserve the indentation and to mark it out as code.
The file object returned by open() can be read in several ways. the readline() method will do what you want, but you do not want to pass it a parameter. In your example code you call it with server.readline(1) which reads at most one character from the file. Just call it with server.readline() and it will read the entire line up to and including the linefeed at the end.
Dave - The Developers' Coach
April 4th, 2005, 10:01 AM
Okay Thanks so readline() will read one line at a time until I say to read another line