try to open &read msg from file ,print the error msg in casse of exception | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

try to open &read msg from file ,print the error msg in casse of exception

24th Oct 2016, 2:11 PM
ashwini salgar
ashwini salgar - avatar
1 Respuesta
+ 1
try: f=open("filename.txt") a=f.read () print a except: print "Error" finally: f.close ()
1st Dec 2016, 12:07 PM
Binara Sachin