Does anyone else have a problem with Python sometimes where an error comes up saying: 'Socket Error: Connection refused'?
I do too, and I'm sorry to say i have no clue why. The best way to fix it is to reboot your PC, it should fix the problem for a while.
The problem is that you close the interpreter window (the interactive window with the >>> prompt). Never close the interpreter window while using IDLE, and you won't see this error! There is absolutely NO reason, ever, to close the interpreter window while you are still using IDLE. If you want to quit the program, you should File -> Quit. If you run a computation, leave the interpreter window open while you go to your code file and fix your code. You can minimize the window if it annoys you, just don't X it out. In-depth problem (if anyone cares): Whenever you open up a new interpreter window, a new socket connection is opened. The problem is, once you X out the interpreter window, the socket connection remains open (and you've lost the ability to close it neatly, by File-> Quitting the program). Your computer can only have so many open sockets before it freaks out; at that point, when the computer flips out, the only real good solution is to restart your computer to force all the socket connections closed.
OOOHHHHH!!! how did i not think of that... thanks a lot!
No problem, glad I can help :)
Join our real-time social learning platform and learn together with your friends!