Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Fast forward-backward (write-read) (http://www.velocityreviews.com/forums/t953799-re-fast-forward-backward-write-read.html)

David Hutto 10-23-2012 11:19 PM

Re: Fast forward-backward (write-read)
 
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


All times are GMT. The time now is 06:35 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.