Skip to content

Commit adfbbd8

Browse files
author
Vimal A.R
committed
* Day 24 of #100DaysofCode
* Added Day-024/02-os.py
1 parent ea203b1 commit adfbbd8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Day-024/02-os.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
3+
# We have seen os.chdir(), os.getcwd()
4+
# in a previous example.
5+
6+
# os.pardir moves to the parent directory
7+
8+
import os
9+
10+
os.rmdir("/tmp/test_1")
11+
os.mkdir("/tmp/test_1")
12+
os.chdir("/tmp/test_1")
13+
print(os.getcwd())
14+
os.chdir(os.pardir)
15+
print(os.getcwd())

0 commit comments

Comments
 (0)