-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathos.py
More file actions
57 lines (28 loc) · 929 Bytes
/
os.py
File metadata and controls
57 lines (28 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
import os
from datetime import datetime
path=os.getcwd()
#print(os.listdir())
#os.makedirs('c:/python_test/test/DEMO')
#os.chdir('c:/python_test/test')
#print(os.listdir())
#os.rmdir('c:/python_test/test/DEMO')
#print(os.listdir())
#print (os.listdir())
#os.rename('test2.txt','test.txt')
#print (os.listdir())
#mod_time=os.stat('test.txt').st_mtime
#print (datetime.fromtimestamp(mod_time))
#for dirpath, dirnames, filenames in os.walk('c:/python_test'):
# print ("dirpath: %s\ndirnames:%s\nfilenames:%s" % (dirpath, dirnames, filenames))
## os.environ
#print(os.environ.items())
## os.path()
#path_file=os.path.join(path,'test.txt')
#print(os.path.basename(path_file))
#print(os.path.dirname(path_file))
#print(os.path.split(path_file))
#print(os.path.exists(path_file))
#print(os.path.isdir(path_file))
print(os.path.isfile(path_file))
print(os.path.splitext(path_file))