I got the following problem: I'm writing a script for Ensight (a program for visualizing CFD computations) in python. The program Ensight gives me a list for the time values like:
print ensight.query(ensight.TIMEVALS)['timevalues']
[[0, 0.0], [1, 9.99e-07], [2, 1.99e-06], [3, 0.0003],etc.]
Where the first value in every list is the timestep and the second value the actual time at this timestep. Now I want to ask somehow for timestep '2' and want to know the corresponding second value of the list. Therefore if I could just find the index of the timestep I could easily have the corresponding time value.
EDIT\\ It solved it now like this:
time_values = ensight.query(ensight.TIMEVALS)['timevalues']
for start,sublist in enumerate(time_values):
if step_start in sublist:
index_begin = start
for end,sublist in enumerate(time_values):
if step_stop in sublist:
index_end = end