django - Python, if else and key modification -


i have 1 program/website read output text file. python read each of line , display on website.

there 2 output python read , display, visual id , time delay. able display visual id in 1 column , both visual id, time delay perfectly.

question

my problem when want display 'time delay' take first output line 'visual id' column, display 2 column.

enter image description here

  • i want display 'time delay' in 1 column.

views.py

        open(path) input_data:          line in input_data:             if 'visual' in tokens , line.startswith('2_visualid_'):                 prev_key = line.lstrip('2_visualid_').rstrip()                 data.update({prev_key: []})               if 'time' in tokens:                 if search_string in line , prev_key in data:                     data[prev_key].append(next(input_data).lstrip('2_mrslt_').rstrip())                  else:                      if search_string in line:                         prev_key = (next(input_data).lstrip('2_mrslt_').rstrip())                         data.update({prev_key: []})         context = {'output': data} 

form html

<form action="">  &nbsp&nbsp<input class="regular-checkbox" type="checkbox" name="token" value="visual"><b>&nbsp&nbsp visual id</b><br> &nbsp&nbsp<input class="regular-checkbox" type="checkbox" name="token" value="time"><b>&nbsp&nbsp time delay index</b>  </form> 

table html

<div class="input-group" align="center" style=" left:10px; top:-110px; width:99%">             <table class="table table-bordered">                  <thead class="success" >                  <tr>                      <th class="success">                         <b>visual id</b>                     </th>                      <th class="success">                      <b>time delay index</b>                      </th>                  </tr>                    {% key, values in output.items %}                  <tr class="warning">                     <td rowspan={{ values|length|add:1 }}><b>{{ key }}</b></td>                      {% value in values %}                      <tr class="warning">                     <td ><b>{{value}}</b></td>                     </tr>                      {% endfor %}                      </tr>                  {% endfor %}                  </thead>              </table>     </div> 


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -