Skip to content

Instantly share code, notes, and snippets.

@Sebastian1011
Last active December 1, 2023 05:47
Show Gist options
  • Save Sebastian1011/d0b9a8dcbb760c26afdb6352d1897906 to your computer and use it in GitHub Desktop.
Save Sebastian1011/d0b9a8dcbb760c26afdb6352d1897906 to your computer and use it in GitHub Desktop.
Bash start python simple server
#!/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