Sep-04-2020, 02:06 AM
Backslashes are special in strings, but regular slashes are not. You don't need to double them up.
Is it creating the file?
I'd prefer to see you store the string in a variable so you don't have to create it twice.
Is it creating the file?
I'd prefer to see you store the string in a variable so you don't have to create it twice.
output = "".join(islice(f, index - 5, index + 4)) print(output) outfile.write(output)