ValueError:int()的无效文字,以10为底:''字符串编号为int错误

时间:2019-01-10 13:30:47

标签: python string int

将字符串整数更改为int类型时出现Python错误!

你好!我正在编码一个数据库系统,并在文件内放置了一个数字10000,其中没有任何其他字符。然后,当我在代码中打开它并尝试将其更改为整数时,它给出了错误! tkinter也发生了同样的事情。

name = input("What is the name of the item? > ")
model = input("What is the model of the item? > ")
cob = input("How much buying it cost? > ")
db.inventory(name, model, cob)
overall_read = open("overall", "r")
overall_write = open("overall", "w")
overall_read_read = overall_read.read()
overall_new_int = int(overall_read_read)
cob_int = int(cob)
overall_new = overall_new_int - cob_int
overall_write.write(str(overall_new))
main()

应更改为10000的整数!

0 个答案:

没有答案