try to open &read msg from file ,print the error msg in casse of exception | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
+ 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