- 1
How do i skip strings using open()?
f =("filename.txt", "r") print(f.readline(x))
4 Risposte
+ 2
Ace Brown if you know how far you want to skip or exactly where you want to start reading next, you can use the seek() method.
https://www.tutorialspoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK/file_seek.htm
Otherwise, you can just read the strings and not use them until you get to the desired place in the file.
+ 2
I would use something like this if I knew exactly what line I want to start with:
x = int(input())
import itertools
with open('yourfile.txt') as f:
    line_to_begin = f.readlines()[x:]
0
Let's say I want to begin after the first 5 characters  would I have to do those things ?
X =  int(input(?) )
Import intertools 
With open ('filename.txt) as f:
    Lin_to_begin = f.readline()[5:]
??
0
Ace Brown based on the rewrite yes that should skip over the first 5 strings  not characters
I used x as int(input()) as a means to point to how many strings you wanted to skip.



