文章90
标签1
分类38

With语句

该语句就是不用关闭文件

 """
fp=open("./withtest.txt",'r')
print(fp.read())
fp.close()
"""

#./表示当前目录

#with实现   encoding="UTF-8" 打开中文的格式输出
with open('模块/常见模块.py','r',encoding="UTF-8") as fp:
    print(fp.read())




0 评论

">