-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilehe.py
More file actions
164 lines (111 loc) · 2.58 KB
/
filehe.py
File metadata and controls
164 lines (111 loc) · 2.58 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# # file hendling me file 2 type ki
# # text file
# # binary file esme idio or vidio or img rakte he
# # open()
# # write /read/delet/edit
# # close()
# # new file creat
# p=open('h5.txt','x')
# print(p.mode)
# print(p.closed)
# p.close()
# print(p.closed)
# f=open('h5.txt','w')
# print(f.mode)
# print(f.closed)
# f.close()
# print(f.closed)
# f=open('h1.py','x')
# print(f.mode)
# # new data likne ke liye
# # p=open('h5.txt','w')
# # p.write('this is new')
# # p.close()
# # maltiple line ke liye
# p=open('h5.txt','w')
# data=("this is my new data \n","my name is brajesh \n", "go to ehore")
# p.writelines(data)
# print(p.writable())
# f=open('file01.txt','w')
# f.write("this is my new file in 02/08/2024")
# f.close()
f=open('file01.txt','r')
f.write("this is my new file in 02/08/2024")
data=f.read()
print(data)
# # read karne ke liye
# p=open('h5.txt','r')
# print(p.mode)
# data=p.read()
# print(data)
# # p=open('h5.txt','r')
# # print(p.mode)
# # data=p.read()
# # print(data)
# # p.read(10)
# # p.close()
# # p=open('h5.txt','a')
# # p.write("\nHello to the world of python")
# # p.close()
# # p=open('h5.txt','a')
# # p.write("\nHello to the world of python")
# # p.close()
# # p=open('h5.txt','r+')
# # p.write("\nHello to the world of python")
# # print(p.readable())
# # p.close()
# # tell ka use ham cursur point dekne ke liye karte he
# # p=open('h5.txt','r')
# # print(p.tell())
# # print(p.read(5))
# # print(p.tell())
# # print(p.read(10))
# # print(p.tell())
# # print(p.readline())
# # print(p.tell())
# # print(p.read())
# # print(p.tell())
# # print(p.read(5))
# # seek ki requrmnet jis index par ke ke jana ho baha par
# # p=open('h5.txt','r')
# # print(p.tell())
# # print(p.read(3))
# # (p.seek(0))
# # print(p.tell())
# # print(p.read(10))
# # print(p.tell())
# # p.seek(15)
# # print(p.tell())
# # baynary mode me
# # p=open('h5.txt','rb')
# # print(p.tell())
# # p.seek(-10,2)
# # print(p.tell())
# # print(p.read(10))
# p=open('h5.txt','rb')
# print(p.tell())
# p.seek(10,1)
# print(p.tell())
# print(p.read(10))
# p=open('h5.txt','rb')
# print(p.tell())
# print(p.read(12))
# p.seek(10,0)
# print(p.tell())
# print(p.read(10))
# p.close()
# # esa likhne se close nahi karna padta he
# # with open('h5.txt','r')as p:
# # print(p.read(10))
# # print(p.tell())
# # p.seek(10)
# # print(p.tell())
# # print(p.closed)
# # print(p.closed)
# with open('h5.txt','rb')as p:
# print(p.read(10))
# print(p.tell())
# p.seek(10,1)
# print(p.tell())
# print(p.closed)
# print(p.closed)