-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile Handling.py
More file actions
94 lines (64 loc) · 1.26 KB
/
Copy pathFile Handling.py
File metadata and controls
94 lines (64 loc) · 1.26 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import os
'''
1.getcwd----Current file path
2.chdir----->give the path and getcwd
3.mkdir---->create a folder
'''
# print(os.getcwd())
# print(os.chdir(r"C:\Users\WELCOME\OneDrive\Desktop\Python"))
# print(os.getcwd())
#
# import os
#
# os.mkdir('python')
#
# import os
# os.popen("C:\Users\WELCOME\OneDrive\Desktop\SQL.txt")
'''
1.getcwd()
2.chdir()
'''
# import os
# os.getcwd()
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# print(os.getcwd())
'''
3.mkdir(create the folder in desktop)
'''
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.mkdir('e12')
'''
4.rmdir(remove the folder in desktop)
'''
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.rmdir('e12')
# os.rmdir('e12')
'''
Method Related to file
'''
'''
1.popen()
'''
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.popen("SQL.txt",'r')
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.popen("Sample.txt","r")
'''
2.Rename()
'''
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.rename('Sample.txt','sample.txt')
# os.popen('sample.txt','r')
# os.rename('sample.txt','Sample.txt')
'''
3.Remove()
'''
# import os
# os.chdir(r'C:\Users\WELCOME\OneDrive\Desktop')
# os.remove('Demo.txt')
# os.remove('Demo.txt')