正在加载图片...
9.1 PYTHON中文件的打开和关闭 例9.2】文件基本操作(打开模式) #相当于或过 fl=open('studentinfo.tx对捫 print(文件打开模式为:",fl.mode f1.close() #以文本模式写入 f2=open("studentinfo.txt,w') f2.close() #以二进制模式读写 f3=open ("studentinfo.jpg",'r+b) f3.close() 运行结果 文件打开摸式为:9.1 PYTHON中文件的打开和关闭 例9.2】文件基本操作(打开模式) #相当于'r'或'rt f1= open("studentinfo.txt") print("文件打开模式为:",f1.mode) f1.close() #以文本模式写入 f2=open("studentinfo.txt",'w') f2.close() #以二进制模式读写 f3= open ("studentinfo.jpg",'r+b') f3.close() 运行结果: 文件打开模式为: r
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有