外部文件python - 写入外部文本文件

时间:2017-01-23 16:48:21

标签: python external textwrapping

我的python代码有问题,

print("Your memeory size is",memory)
while not any(words in problem for words in ListProb):
    problem = input ("Explain what is wrong with your phone to get the most accurate answer you should use the keywords at the bottom left.")
    case = str(random.randint(1,10000))
    print ("Thank you " + name + " for your information.  We can not solve this for you at the minute.  We will pass on your infomation to our tecnician and get back to you soon.  Your case number is "+ str(case) + ".  Thanks.")
    file = open('Case_data_file ' + case + '.txt','a')
    file.write("Client name:                       " + name + "\n" + "\n" + "Phone model:                       " + model + "\n" + "Memory size:                       " + memory + "\n" + "Your allocated case number:        " + str(case) + "Phone Problem:                     " + problem + "\n")
    file.close()
    exit()

出现以下错误。

  

TypeError:'_ io.TextWrapper'对象不可调用

有什么想法吗?

0 个答案:

没有答案