Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31970 > unrolled thread

Re: Fast forward-backward (write-read)

Started byDavid Hutto <dwightdhutto@gmail.com>
First post2012-10-23 19:19 -0400
Last post2012-10-23 19:19 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Fast forward-backward (write-read) David Hutto <dwightdhutto@gmail.com> - 2012-10-23 19:19 -0400

#31970 — Re: Fast forward-backward (write-read)

FromDavid Hutto <dwightdhutto@gmail.com>
Date2012-10-23 19:19 -0400
SubjectRe: Fast forward-backward (write-read)
Message-ID<mailman.2699.1351034371.27098.python-list@python.org>
Whether this is fast enough, or not, I don't know:


filename = "data_file.txt"
f = open(filename, 'r')
forward =  [line.rstrip('\n') for line in f.readlines()]
backward =  [line.rstrip('\n') for line in reversed(forward)]
f.close()
print forward, "\n\n", "********************\n\n", backward, "\n"


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web