我试图从一个读文件转换一个str,但它似乎不起作用,我必须用这个int从另一个文件中取出。。。在
我试过int(variable),但没用。。在
写在我的手机上,很抱歉有任何错误
我将这个int从start保存到一个.txt,然后重新打开并再次读取/写入(save file)
def save():
hp = 20
hp1 = str(hp)
a1 = open("saves\DQ1", "w")
a1.write(hp1)
def load():
a1 = open("saves\DQ1", "r")
hp = a1.read()
一。在
既然我对这个问题不太了解,而你却在用手机发帖,我先从一个简单的解决方案开始。看看这对你是否有用:
相关问题 更多 >
编程相关推荐