#创建一个文件
f = open("test.log","w")
f.write("abcd")
f.close()
#读取一个文件
f = open("test.log","r")
read = f.read(2) #可以直接读取文件中的字节数,不填写直接全部读取
print(read)