Re: EOFError why print(e) cannot print out any information ?

2012-12-26 Thread Peter Otten
iMath wrote: > f = open('UsersInfo.bin','rb') > while True: > try: > usrobj = pickle.load(f) > except EOFError as e: > print(e) > break > else: > usrobj.dispuser() > f.close() > why print(e) cannot print out

Re: EOFError why print(e) cannot print out any information ?

2012-12-25 Thread Andrew Berg
On 2012.12.25 23:26, iMath wrote: > why print(e) cannot print out any information ? If you want to manipulate tracebacks, use sys.exc_info() and the traceback module from the standard library. The logging module also comes with an exception() function and an exception() method for Logger objects th

EOFError why print(e) cannot print out any information ?

2012-12-25 Thread iMath
why print(e) cannot print out any information ? class user: def __init__(self, x,y,z): self.id = x self.name = y self.emailadd=z def dispuser(self): print('User ID: ', self.id) print('User Name : ', se