python如何将数据结果保存下来

       print(y_value)
        f = open("text.txt", 'wb')
        f.write(y_value)
        f.close()
        return y_value

python将数据保存到文本里,但是打开文本为啥是这样的乱码小方块?

f = open("text.txt", 'wb')改为f = open("text.txt", 'w')