Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I exit SimpleHTTPServer without closing terminal?

I am running the SimpleHTTPServer from powershell.

python -m SimpleHTTPServer 8080  

I want to exit (control + break) the server without closing the terminal. Any ideas?

Thanks in advance for any suggestions

like image 649
bcollins Avatar asked Feb 19 '26 12:02

bcollins


1 Answers

^C will close it (control + c)

Example of me testing control + c to send an interupt and exit:

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

Keyboard interrupt received, exiting.

Note, I am using http.server as this replaces SimpleHTTPServer in Python 3 but it should work the same for you.

like image 163
Nathan Avatar answered Feb 21 '26 01:02

Nathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!