- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path20_osModule.py
More file actions
Latest commit
35 lines (22 loc) · 563 Bytes
/
Copy path20_osModule.py
File metadata and controls
35 lines (22 loc) · 563 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
importos
print(os.getcwd())
print(os.listdir("."))
os.chdir("__pycache__")
print(os.getcwd())
os.chdir("..")
os.mkdir("numpy")
os.rmdir("numpy")
#os.rename('da', 'dataSet')
path=os.path.join("D","python","programs")
print(path)
pathSplit=os.path.split("dic/python/numpy")
print(pathSplit)
print(os.path.exists("d/hello/python"))
print(os.path.isfile("customPackages.py"))
print(os.path.isdir("__pycache__"))
print(os.system("ls"))
#error Handling i python
try:
os.remove('python.txt')
exceptFileNotFoundError:
print("File not found!")