[BangPypers] Hi

Noufal Ibrahim noufal at gmail.com
Fri Mar 12 07:57:44 CET 2010


On Fri, Mar 12, 2010 at 12:04 PM, Goudar, Girish
<Girish.Goudar at goodrich.com> wrote:
> Hi,
>
>
>
> Can u pls tell what the return value of python function is?
>
>
>
> socket.connect((host, port))
>
>
>
> on SUCCESS and on FAIL?

The details are at http://docs.python.org/library/socket.html

Python code doesn't usually rely on returning an error value. All
error conditions are abstracted into exceptions which your calling
code can catch. From the docs.

    All errors raise exceptions. The normal exceptions for invalid
argument types and out-of-memory conditions can be raised; errors
related to socket or address semantics raise the error socket.error.

[..]


-- 
~noufal
http://nibrahim.net.in


More information about the BangPypers mailing list