Skip to content

Commit

Permalink
update timedata example
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Jan 23, 2025
1 parent fd2dbfa commit d4a6da7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/timedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from wxmplot import PlotApp
from datetime import datetime
f = open('time.dat','r')
l = f.readlines()
f.close()
t = []
x = []
for i in l:

with open('time.dat','r') as fh:
lines = fh.readlines()

t, x = [], []
for i in lines:
j = i[:-1].strip().split()
t.append(datetime.fromtimestamp(float(j[0])))
x.append(float(j[1]))
Expand Down

0 comments on commit d4a6da7

Please sign in to comment.