# -*- coding: cp936 -*- fname=raw_input("filename:") print try: fobj=open(fname,'r') except IOError,e: print "%s not exists" %fname,e else: for eachline in fobj: print eachline, fobj.close()