Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31981
| Date | 2012-10-23 19:30 -0500 |
|---|---|
| From | Tim Chase <python.list@tim.thechases.com> |
| Subject | Re: Fast forward-backward (write-read) |
| References | <5086AA35.4000509@it.uu.se> <5086C156.40707@tim.thechases.com> <5086D13F.80006@it.uu.se> <5086DA4D.4060204@tim.thechases.com> <5086E3D0.7030501@it.uu.se> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2707.1351038598.27098.python-list@python.org> (permalink) |
On 10/23/12 13:37, Virgil Stokes wrote:
> Yes, I do wish to inverse the order, but the "forward in time"
> file will be in binary.
Your original post said:
> The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format
making it hard to know what sort of data is in this file.
So I guess it would help to have some sample data to work with, even
if it's just some dummy data and a raw processing loop without doing
anything inside it. Something like the output of either of these
$ xxd forward_data.txt | head -50 > forward_head.txt
$ od forward_data.txt | head -50 > forward_head.txt
plus a basic loop to show how you're extracting the values:
for line in file("forward_head.txt"):
data1, data2, data3 = process(line)
and how you want to reverse over them:
for line in file("reversed.txt"):
if same_processing_as_forward_source:
data1, data2, data3 = process(line)
else:
data1, data2, data3 = other_process(line)
or do you want something more like
for line in super_reverse_magic(file("forward_head.txt")):
data1, data2, data3 = process(line)
?
-tkc
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Fast forward-backward (write-read) Tim Chase <python.list@tim.thechases.com> - 2012-10-23 19:30 -0500
csiph-web