IDLE’s subprocess didn’t make
connection. Either IDLE can’t start a
subprocess or personal firewall
software is blocking the connection.
Don’t think this has been asked-how come this comes up occasionally when running very simple programs-I then have to go to Task Manager & stop all Pythonw processes to get it to work again?
It seems to happen randomnly on different bits of code-here is the one I’m doing at the moment-
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()
Sometimes it works, sometimes it doesn’t!
In Python 3.0.1, I have gotten that error after I Ctrl-C to interrupt a previous run of a program in Idle’s Python Shell and then try to run a script.
Also in 3.0.1: Let’s say you have two Idle windows open: a script open for editing in one, and Idle’s Python Shell window. I have found that if you close the shell window and then immediately try to run the script, it will give that error when it tries to re-open the shell – but not if you wait a bit in between to let Idle do whatever connection clean up it needs to do.
Worse bugs I have found (again, in v3.0.1- not sure if this would happen in the 2.x versions):
I had a long script – getting up towards 9k lines – and once it got to a certain size, doing “save as” on it would crash Idle. I am not sure what the exact threshold was for size – but before that, I would also get some intermittent “save as” crashes that seemed to depend on what else I had going on – other Idle windows, how much output was in the shell window perhaps – stuff like that. It can crash and you will lose unsaved work.
Also – one thing I commonly do is have a scratch window open where I cut and paste bits of code in various stages of validity, write notes to myself, etc – so not a valid python script, but I sometimes save these so I can come back to them. I have one such file that will crash Idle every time I try to open it – and I lost unsaved work the first time. (FYI: Other editors including PythonWin 2.5.2 have no problem opening the file.)