Last active
December 1, 2023 05:47
-
-
Save Sebastian1011/d0b9a8dcbb760c26afdb6352d1897906 to your computer and use it in GitHub Desktop.
Bash start python simple server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
# server port can not be empty | |
echo "server stoped, please input serve port" | |
exit | |
fi | |
echo "Python SimpleHTTPServer Start at port: $1" | |
while true | |
do | |
python -m SimpleHTTPServer $1 | |
sleep 1 | |
#statements | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment