-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdating.py
32 lines (22 loc) · 833 Bytes
/
updating.py
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
# with open("newfile.txt","r+", encoding="utf-8") as file:
# file.seek(20)
# file.write("deneme")
# with open("newfile.txt","r+", encoding="utf-8") as file:
# print(file.read())
# ***** Sayfa sonunda güncelleme *****
# with open("newfile.txt","a", encoding="utf-8") as file:
# file.write("\nEmel Turan")
# ***** Sayfa başında güncelleme *****
# with open("newfile.txt","r+", encoding="utf-8") as file:
# content = file.read()
# content = "Efe Turan\n" + content
# file.seek(0)
# file.write(content)
# ***** Sayfa ortasında güncelleme *****
with open("newfile.txt","r+", encoding="utf-8") as file:
list = file.readlines()
list.insert(1,"Yılmaz Aygün\n")
file.seek(0)
file.writelines(list)
with open("newfile.txt","r", encoding="utf-8") as file:
print(file.read())