forked from Shwetha-Kalavara/Python_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics_os.py
More file actions
40 lines (21 loc) · 681 Bytes
/
Copy pathbasics_os.py
File metadata and controls
40 lines (21 loc) · 681 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
import os
# current working directory
print(os.getcwd())
# path = r"C:\Users\Vidyashree M C\PycharmProjects\Alpha4\Datatypes"
# changing the directory
# os.chdir(path)
# print(os.getcwd())
# creating folder
# os.mkdir("sample")
# delete folder
# os.rmdir("sample")
# path = r"C:\Users\Vidyashree M C\PycharmProjects\Alpha4"
# os.chdir(path)
# print(os.listdir(path))
# creating a file
# os.mkdir("overriding_class_variable.py")
# os.rmdir("overriding_class_variable.py")
# removing a file
# os.remove("overriding_class_variable.py")
path = r"C:\Users\Vidyashree M C\PycharmProjects\Alpha4\files\sample.txt"
os.popen(path)