python学习之——openfiles.py

it2022-05-05  101

# -*- 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()

转载于:https://www.cnblogs.com/cloverclt/p/4757353.html

相关资源:使用Python在Windows下获取USB PID&VID的方法

最新回复(0)