[Tutor] 答复: Any book to study Python

wesley chun wescpy at gmail.com
Wed Mar 28 20:40:07 CEST 2012


> I'm reading your book and just typeing the TCP server and client example scripts to my python and run it, but I did not get the expected results.
>
> For tstclnt.py(example 16.2,page 473 on the book),when I typed in vi and execut it by python tstclnt.py, I get the error of 'No route to host'.
>
> Of course I modified the IP address to 192.168.1.11 which is on another linux server in the script, I pinged the 192.168.1.11 and get successfully.(On 192.168.1.11 I run the TCP server program, it is the one on the book)
>
> Please see the screen shot for detail.
>
> Can you give me some suggestion on this error?



hi xianming,

any of the tutors here can help you, not just me! :-)

instead of a screenshot (many people use only terminals to read
email), it's best to just cut-n-paste the code and error traceback
into your email. based on what you sent in, it would be worthwhile for
you to also post the server code and output as well.

note that a positive ping and the client speaking to an address are
somewhat but not entirely related. the reason is that different
network protocols are being used. ping uses ICMP --
http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol --
while the code uses TCP --
http://en.wikipedia.org/wiki/Transmission_Control_Protocol -- instead.

once you provide the server code and output, people may be able to
help you better.

best regards,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A computer never does what you want... only what you tell it."
    wesley chun : wescpy at gmail : @wescpy/+wescpy
    Python training & consulting : CyberwebConsulting.com
    "Core Python" books : CorePython.com
    Python-flavored blog: wescpy.blogspot.com


More information about the Tutor mailing list