Possible Duplicate:
Python how to read N number of lines at a time
Read a File 8 Lines at a Time Python
I am trying to read a file line by line given 8 lines at a time and then use those values as variables in my code
The problem is the way its being read or the method that is reading it doesn't work as a string variable in my code
using Read seems to work but I don't know how to read the file using the read() Function 8 lines at a time.
any idea how I can do this?
Thank You
Edit More detail
I am using the library spynner. I can use any number of code to read the file n lines at a time, but actually using the lines as values in a function for spinner isn't working. For example
I use this to read the file
with open("test.txt") as fin:
try:
while True:
data = islice(fin, 0, 8)
email = next(data)
Then in Spynner I do this
browser.wk_fill('input[name="email"]', email)
Which doesn't get filled in the form. I am not building a bot, or spam tool just messing around really.
So appreciate any feed back / help
*cheers