-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
47 lines (37 loc) · 1.31 KB
/
config.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
#def main():
# try:
# configuration = open('config.txt')
# except FileNotFoundError:
# print("Couldn't find the config.txt file!")
#if __name__ == '__main__':
# main()
#---------------------------------------------------------
#def main():
# try:
# configuration = open('config.txt')
# except Exception:
# print("Couldn't find the config.txt file!")
#def main():
# try:
# configuration = open('config.txt')
# except FileNotFoundError:
# print("Couldn't find the config.txt file!")
#except IsADirectoryError:
# print("Found config.txt but it is a directory, couldn't read it")
#grupando las excepciones
#def main():
# try:
# configuration = open('config.txt')
# except FileNotFoundError:
# print("Couldn't find the config.txt file!")
# except IsADirectoryError:
# print("Found config.txt but it is a directory, couldn't read it")
# except (BlockingIOError, TimeoutError):
# print("Filesystem under heavy load, can't complete reading configuration file")
try:
open("config.txt")
except OSError as err:
if err.errno == 2:
print("Couldn't find the config.txt file!")
elif err.errno == 13:
print("Found config.txt but couldn't read it")