TypeError:+:'_io.TextIOWrapper'和'int'不支持的操作数类型不起作用?

时间:2017-02-07 11:39:30

标签: python

def failure():
    print("Unfortunately there is no solution for your device.")
    case_n = file = open("File Numbers.txt", "r")
    case_number = case_n + 1
    file.close()
    file=open("Case " + str(case_number) + ".txt" , "w")
    file.close()
def solution():
    file = open(phone_folder)
    ans = file.read()
    file.close()
    print(ans)


import os.path
phone=input("What make is your phone?")
phone_folder = (phone + ".txt") 
if os.path.isfile(phone_folder):

    solution()
else:
    failure()

input()
  

我想创建一个每次都有不同编号的文本文件。并在其中写下手机的名称。

0 个答案:

没有答案