#打开文件
with open('H:/jmeter参数文件/111.txt','r') as f:
print(f.read(1))
print(f.readline())
print(f.readline())
for n in f.readlines():
print(n.strip())# 把末尾的'\n'删掉
#打开图片的二进制数据
with open('C:/Users/Public/Pictures/Sample Pictures/1.2.jpg','rb') as g:
print(g.read())
#把打开的文件中的内容写进另一个文件中
with open('H:/python文件/1.txt','w') as w:
with open('H:/jmeter参数文件/111.txt','r') as f:
w.write(f.read())