如何关闭python simpleHTTPserver? [英] How do I shut down a python simpleHTTPserver?
问题描述
所以我想学习d3,维基建议
So I'm trying to learn d3, and the wiki suggested that
要在本地查看示例,您必须拥有本地Web服务器。任何
网络服务器将工作;例如你可以运行Python的内置
服务器:
To view the examples locally, you must have a local web server. Any web server will work; for example you can run Python's built-in server:
python -m SimpleHTTPServer 8888&
很好...只有现在我有一个服务器运行...但在某个时候,我想我应该可能再次关闭。
Great... only now I have a server running... but at some point I think I should probably shut that down again.
有没有比使用 kill< pid>
更好的关闭方法?这似乎是一个大锤子一个小工作。
Is there a better way of shutting it down than using kill <pid>
? That seems like kind of a big hammer for a little job.
(我正在运行Mac OS 10.6.8(Snow Leopard))
(I'm running Mac OS 10.6.8 (Snow Leopard))
FWIW: ctrl + c
提供约10行追踪,抱怨被中断。
FWIW: ctrl+c
gives about 10 lines of traceback, complaining about being interrupted.
kill -3< ; pid>
在单独的窗口中发出Finder警告Python意外退出。
kill -3 <pid>
gives a Finder warning in a separate window 'Python quit unexpectedly'.
默认 kill< pid>
和 kill -15< pid> / code>相对干净(和简单)。
The default kill <pid>
and kill -15 <pid>
are relatively clean (and simple).
推荐答案
您只是向进程发送信号。 kill
是发送这些信号的命令。
You are simply sending signals to the processes. kill
is a command to send those signals.
键盘命令Ctrl + C( ^
+ C
)发送SIGINT, kill -9
发送SIGKILL, kill -15
发送SIGTERM。
The keyboard command Ctrl+C (⌃
+C
) sends a SIGINT, kill -9
sends a SIGKILL, and kill -15
sends a SIGTERM.
您要传送至伺服器以结束什么讯号?
What signal do you want to send to your server to end it?
这篇关于如何关闭python simpleHTTPserver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!