-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreading.py
54 lines (38 loc) · 980 Bytes
/
reading.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# try:
# file = open("newfile2.txt","r")
# print(file)
# except FileNotFoundError:
# print("dosya okuma hatası")
# finally:
# print("dosya kapandı.")
# file.close()
# file = open("newfile.txt","r", encoding = "utf-8")
# ********** for döngüsü
# for i in file:
# print(i, end="")
# ********** read() fonksiyonu
# content1 = file.read()
# print("içerik 1")
# print(content1)
# content2 = file.read()
# print("içerik 2")
# print(content2)
# content = file.read(5)
# content = file.read(3)
# content = file.read(3)
# print(content)
# ********** readline() fonksiyonu
# print(file.readline(),end="")
# print(file.readline(),end="")
# print(file.readline(),end="")
# print(file.readline(),end="")
# print(file.readline(),end="")
# print(file.readline())
# print(file.readline())
# print(file.readline())
# ********** readlines() fonksiyonu
# liste = file.readlines()
# print(liste[0])
# print(liste[1])
# print(liste[2])
# file.close()