I'm trying to configure my computer to allow Scratch to communicate with Python. When I run the sample code (from http://wiki.scratch.mit.edu/wiki/Communicating_to_Scratch_via_Python) in Python and get the error as follows:
File "C:\scratchtest", line 22, in <module>
scratchSock.connect((HOST, PORT))
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
In the sample code,
HOST = '127.0.0.1'
PORT = 42001
Any ideas on what I need to do to Norton Firewall to unblock the right host/port combination?
Offline
TRocket wrote:
check scratch is running and remote sensor connections are enabled (sensing -> right click (< ^> sensor value) -> enable remote sensor connections)
Yeah, this may be the problem, check that.
Usually the computer does not block 127.0.0.1 since it's on the same machine.
Offline
Thanks all. Looks like I needed to disable then enable remote connections once python was running. Odd, but seemed like scratch needed to reset or something.
Got it working.
Thanks, scratchers, for the quick advice!
Offline