```pythonimport sys
def text_create(name):
# 此处是服务器地址,可以改为本地
desktop_path = "D:\\Python\\Python.m\\TEST\\venv\\Scripts\\A\\"
# 新创建的txt文件的存放路径
full_path = desktop_path + name + '.txt'
# 也可以创建一个.doc的word文档
# full_path = desktop_path + name + '.doc'
file = open(full_path, 'w')
filename = 'log'
text_create(filename)
output = sys.stdout
outputfile = open("D:\\Python\\Python.m\\TEST\\venv\\Scripts\\A\\" + filename + '.txt', 'w')
sys.stdout = outputfile
#输入运行部分
pred = "Pred Values--"
print(pred, file=outputfile)
outputfile.close() # close后才能看到写入的数据
```