Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mytests
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songxinkai
mytests
Commits
52d167e3
Commit
52d167e3
authored
Oct 30, 2018
by
songxinkai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file_update_time.py
parent
16c32595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
python/file_update_time/file_update_time.py
+14
-0
No files found.
python/file_update_time/file_update_time.py
0 → 100644
View file @
52d167e3
import
os
import
time
data_root
=
"training_data"
dir_sttime
=
{}
for
f
in
os
.
listdir
(
data_root
):
dir_sttime
[
f
]
=
os
.
stat
(
os
.
path
.
join
(
data_root
,
f
))
.
st_mtime
-
time
.
time
()
for
f
,
t
in
sorted
(
dir_sttime
.
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
):
if
t
<
3600.0
:
print
"file
%
s: update
%.1
f seconds ago"
%
(
f
,
t
)
elif
t
/
3600.0
<
24.0
:
print
"file
%
s: update
%.1
f hours ago"
%
(
f
,
t
/
3600.0
)
else
:
print
"file
%
s: update
%.1
f days ago"
%
(
f
,
t
/
3600.0
/
24.0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment