from time import time
from os.path import getmtime
import numpy as np
path = '/tmp/test.npz'
print(time()); np.savez(path, **{'a': 1, 'b': 2}); print(getmtime(path))
给我
1562961763.9898937
1562961763.9877298
为什么mtime更小?这意味着path
的最后修改时间是之前运行修改命令的时间。这怎么可能?!