[Tutor] error_connection_refused

Alan Gauld alan.gauld at btinternet.com
Tue Jun 5 23:12:28 CEST 2012


On 05/06/12 12:53, BILAL Mustapha wrote:
> Hello,

Hi, Its best not to hijack somebody else's thread coz it messes up all 
the threaded mail/news readers out there. (At least you changed the 
subject though!). Please start with a fresh mail for a new topic.


> I am trying to lunch a small python program but I am always getting this
> error:

How are you "launching" it? From a batch file or shell script?
 From another Python program? From the Python prompt?

> s.connect((IP, PORT))
> File "/usr/lib/python2.7/socket.py", line 224, in meth
> return getattr(self._sock,name)(*args)
> socket.error: [Errno 111] Connection refused
>
> What's weird that it doesn't even print the line "test sending data" so
> how it could get to s.connect() without passing through this line!!

It sounds like you might be using  a Python >>> prompt and not reloading 
the module after making changes. importing a second time won't work as 
Python knows you already have it and ignores it. You must use reload() 
for changes to take effect.

If thats not it then we need more details about what you are doing.

HTH,

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list