The default Python distribution has a built-in support to the HTTP protocol that you can use to make a simple stand-alone Web server.
The Python module that provides this support is called BaseFTTPServer and can be used in our programs just including it in our sources:
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
Let's start with the first basic example. It just return "Hello World !" on the web browser.
Run it by typing:
debarm:~/playground/python/httpserver# python example1.py
Then open your web browser on this URL: http://fox_ip_address:8080.
"Hello World !" will appear on your browser and two log messages on the FOX console:
Started httpserver on port 8080 10.55.98.7 - - [30/Jan/2012 15:40:52] "GET / HTTP/1.1" 200 - 10.55.98.7 - - [30/Jan/2012 15:40:52] "GET /favicon.ico HTTP/1.1" 200 -
This new example:
Run it by typing:
debarm:~/playground/python/httpserver# python example2.py
then open your web browser on this URL: http://fox_ip_address:8080.
An HTML home page will appear on your browser.
Now explore how to read incoming data from an HTML form.
Run this example:
debarm:~/playground/python/httpserver# python example3.py
and type your name in the "Your name" label.
Arietta G25 is a small and low-cost multi-chip module that integrates:
Basic Version with no strips mounted
| Product description... |
Basic kit to evaluate the Acqua A25 SoM with TFT LCD 4.3 inch
Atmel© Certified Partner
Acme Systems provides this documentation "as is" without warranty or guarantees of any kind. We not provide any direct support for the Open Source preinstalled software but, through these pages and forum posts, all of the information required to obtain the sources, install, use and update the Open Source software that can be run on the Acme boards. Please note that all of the preinstalled software, used on the Acme Systems products, are Open Source so you have to check the license terms provided by the authors (usually the GPL) before using it in any commercial or non-commercial product, by yourself. Before to contact us please note that WE ARE MAINLY HARDWARE DESIGNERS and NOT LINUX GURUS and therefore could be better to post your questions to the Acme Systems forum and ensure that all of the site contributors and large software community can read and reply to your questions.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.