【问题标题】:How can I exit SimpleHTTPServer without closing terminal?如何在不关闭终端的情况下退出 SimpleHTTPServer?
【发布时间】:2013-10-08 21:43:06
【问题描述】:

我正在从 powershell 运行 SimpleHTTPServer。

python -m SimpleHTTPServer 8080  

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

提前感谢您的任何建议

【问题讨论】:

标签: python windows powershell


【解决方案1】:

^C 将关闭它(control + c)

我测试 control + 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,但它应该对你同样有效。

【讨论】:

    猜你喜欢
    • 2015-07-14
    • 1970-01-01
    • 2022-01-22
    • 2019-12-07
    • 2022-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多