python - how to point specific location in a file? -


my file contains tables , other datas, after opening file file handle. want point specific location? example, when find word "pin value" should point there. how point specific location in file?

https://stackoverflow.com/a/4999741/248140 shows how can have random (non-sequential) access file. note still have work out where in file "pin value" located, meaning you'd have have sort of index @ start of file, , you're getting dangerously "i should use proper file format this" territory.

if it's you'll want have contents of file in memory @ once, consider reading file @ start of program , converting whatever internal representation suits best.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -