如何在不关闭终端的情况下退出SimpleHTTPServer?

时间:2013-10-08 21:43:06

标签: python windows powershell

我从powershell运行SimpleHTTPServer。

python -m SimpleHTTPServer 8080  

我想在不关闭终端的情况下退出(控制+中断)服务器。有什么想法吗?

提前感谢任何建议

1 个答案:

答案 0 :(得分:4)

^ C将关闭它(control + c)

我测试控制的例子+ c发送中断并退出:

PS C:\> python -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 ...

Keyboard interrupt received, exiting.

注意,我使用的是http.server,因为它取代了Python 3中的SimpleHTTPServer,但它应该对你有效。