The Python CGI Script to Control the LED.
Here is the documentation generated by MkDocs from the docstrings in the code.
- Raspberry Pi
- LED and 330 ohm resistor
- Raspberry Pi OS
- Python 3
- Python Library: RPi.GPIO
$ git clone https://github.com/KeitetsuWorks/raspi-gpio-web-server.git gpio-web-server
$ cd ./gpio-web-server/
$ pyenv virtualenv 3.7.7 py37-gpio # Optional
$ pyenv local py37-gpio # Optional
$ pip install -r requirements.txt
-
Run the Python script
$ python gpio-web-server.py
-
Access the server with a web browser
http://your_raspi_ip_address:5000/
-
Press Ctrl + c on the terminal to exit
- http.server --- HTTP サーバ — Python 3.10.4 ドキュメント
- cgi --- CGI (ゲートウェイインターフェース規格) のサポート — Python 3.10.4 ドキュメント
- バージョン 3.11 で非推奨: The cgi module is deprecated (see PEP 594 for details and alternatives).
- PEP 594 – Removing dead batteries from the standard library | peps.python.org
- MIT