File size: 642 Bytes
f32c034 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Copyright (c) Antoine Nzeyimana.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from datetime import datetime
def read_lines(file_name):
f = open(file_name, 'r')
lines = [line.rstrip('\n') for line in f]
if len(lines[-1]) == 0:
lines = lines[:-1]
if len(lines[-1]) == 0:
lines = lines[:-1]
if len(lines[-1]) == 0:
lines = lines[:-1]
if len(lines[-1]) == 0:
lines = lines[:-1]
f.close()
return lines
def time_now():
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|