-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpractice.py
More file actions
33 lines (30 loc) · 675 Bytes
/
Copy pathpractice.py
File metadata and controls
33 lines (30 loc) · 675 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
"""
def write_to_file(text):
try:
file = open('random_file.txt', 'a')
file.write(text)
except IOError:
print("ERROR: Can't Open File.")
finally:
file.close()
print(file.closed)
write_to_file("\nLast line and that;s all.")
"""
"""
file_name = "random_file.txt"
with open(file_name, "r") as file:
reader = file.read()
print(file.closed)
print(reader)
# """
# store = ""
file_name = "some_random_file.txt"
# for i in range(65, 90+1):
# store += chr(i)
with open (file_name, "r") as file:
writer = file.read()
print(writer)
# for i in range(0, 10):
# print(i)
# for ch in range(97, 123):
# print(chr(ch))