[bugfix] File wasn't closed explicitly, add implicit close by with statement
This commit is contained in:
parent
6afb61b666
commit
3abeabc75c
2
PyLoT.py
2
PyLoT.py
@ -3475,7 +3475,7 @@ class Project(object):
|
|||||||
File structure (each row): event, date, time, magnitude, latitude, longitude, depth
|
File structure (each row): event, date, time, magnitude, latitude, longitude, depth
|
||||||
separated by :param:separator each.
|
separated by :param:separator each.
|
||||||
'''
|
'''
|
||||||
infile = open(filename, 'r')
|
with open(filename, 'r') as infile:
|
||||||
for line in infile.readlines():
|
for line in infile.readlines():
|
||||||
eventID, date, time, mag, lat, lon, depth = line.split(separator)[:7]
|
eventID, date, time, mag, lat, lon, depth = line.split(separator)[:7]
|
||||||
# skip first line
|
# skip first line
|
||||||
|
Loading…
Reference in New Issue
Block a user