Python: Exception
try:
# 処理
linux_interaction()
except AssertionError as error:
# 例外
print(error)
else:
## 例外がない場合
try:
with open('file.log') as file:
read_data = file.read()
except FileNotFoundError as fnf_error:
print(fnf_error)
finally:
# 最後に必ず実行
print('Cleaning up, irrespective of any exceptions.')