TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python socket programming tutorial

88 点作者 silv3r_m00n超过 12 年前

5 条评论

peter_l_downs超过 12 年前
If you want to understand sockets, there's no excuse for not reading Beej's Guide to Network Programming [1]. It's C, not Python, but it covers all of the dirty details and explains <i>exactly</i> what's going on when you create a socket. For instance, this article never mentions that sockets are file descriptors — in Beej's article, it's right after the introduction (Section 2 [2]).<p>How does this article describe a socket?<p><pre><code> &#62; sockets are the fundamental "things" behind any kind of network communications done by your computer" </code></pre> Not very helpful.<p>[1] <a href="http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html" rel="nofollow">http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html</a><p>[2] <a href="http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#theory" rel="nofollow">http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html...</a>
评论 #4667238 未加载
rflrob超过 12 年前
Is there a reason to catch all those exceptions? If you're just sys.exit()ing anyways, why sacrifice all the traceback info?
评论 #4667405 未加载
djtriptych超过 12 年前
Decent tutorial, though I find the official Python HOWTO to be a more thorough and appropriate introduction to sockets for the complete newbie...<p><a href="http://docs.python.org/howto/sockets.html" rel="nofollow">http://docs.python.org/howto/sockets.html</a>
评论 #4665750 未加载
Myrmornis超过 12 年前
I really highly recommend "Foundations of Python Network Programming" by Brandon Rhodes and John Goerzen. It's just one of the best technical books I've read, from the opening example onwards. <a href="http://www.apress.com/9781430230038" rel="nofollow">http://www.apress.com/9781430230038</a>
评论 #4666251 未加载
njharman超过 12 年前
Shouldn't the first step be install <a href="http://www.zeromq.org/" rel="nofollow">http://www.zeromq.org/</a>? That is some seriously amazing stuff right there. Makes network programming (something I've avoided for years) almost trivial.
评论 #4665351 未加载
评论 #4665195 未加载
评论 #4666775 未加载