擅长:python、mysql、java
<p>我敢肯定你不能让一个web服务器在一行代码中使用sockets和select()。即使不使用分号,也必须有一些循环和控制结构。</p>
<p>你确定这不是你要找的吗?</p>
<pre><code>$ python -m SimpleHTTPServer 8000
Serving HTTP on 0.0.0.0 port 8000 ...
</code></pre>
<p>Python 3版本:<code>python -m http.server 8000</code></p>