gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 09:20:38 26 4
gpt4 key购买 nike

我正在从 powershell 运行 SimpleHTTPServer。

python -m SimpleHTTPServer 8080  

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

提前感谢您的任何建议

最佳答案

^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,但它对您来说应该是一样的。

关于python - 如何在不关闭终端的情况下退出 SimpleHTTPServer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19259004/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com