[Tutor] Socket connection refused

Djoumy . deadviannou at caramail.com
Tue Feb 24 09:37:27 EST 2004

 ok Alan and Nick you got the same idea but I still have my problem :

1 - I open client.py (or fclient.py that's the same one) with IDLE, launch
server.py (or fserver.py) 
typing "python server.py" in a command prompt. The server is
well launched, and running the client module 
under IDLE gives a good result : it sends and receives "Hello world"
as expected. yeah great :)

2 - Now the same thing but launching the client (after the server) in another
command prompt "python 
client.py". And there I got the problem : Connection refused...

Now I'm sure it's not coming from py2exe but I still don't understand what's
the difference between launching 
the client under IDLE or in a command prompt....


------- Message original ------- 
De:  Alan Gauld  <alan.gauld at blueyonder.co.uk> 
Date: Mon, 23 Feb 2004 22:18:20 -0000 
Sujet: Re: [Tutor] Socket connection refused 

> I have found two ways to test this : I compile the server with
> py2exe and launch it, then I can run the client
> either running the module under IDLE or compiling it with py2exe.

I strongly recommend that you do NOT use py2exe until you get your
program working. One thing at a time. Its also much faster to develop
the program if you don;t have to go through the py2exe stage every
time yopu make a change!

Just run your client and server from a pair of command prompt windows.

Use Start-Run and enter "COMMAND" to start a command prompt
(aka DOS box). Do it twice to get two.

In one box start your client by typing:

C:\>python client.py

And in the other start your server

C:\>python server.py

(Actually its usually better to start the server first!)

Now you should see the prompts and output of each program in its
own box.

And having just seen the code I notice its a Tkinter client so
you only need one DOS box for the server, you can start the client
just by double clicking in explorer...


Alan G
Author of the Learn to Program web tutor

Pour gagner une Playstation 2, envoyez un SMS avec le code PS au 61321 (0,35 euro hors coût du SMS).

More information about the Tutor mailing list