IDLE 的子进程没有建立连接。IDLE 无法启动子进程或个人防火墙软件阻止了连接。
不要认为这已经被问过了——为什么在运行非常简单的程序时偶尔会出现这种情况——然后我必须去任务管理器并停止所有 Pythonw 进程才能让它再次工作?
它似乎随机发生在不同的代码位上——这是我目前正在做的——
f = open('money.txt')
currentmoney = float(f.readline())
print(currentmoney, end='')
howmuch = (float(input('How much did you put in or take out?:')))
now = currentmoney + howmuch
print(now)
f.close()
f = open('money.txt', 'w')
f.write(str(now))
f.close()
有时有效,有时无效!