Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours
False. With standard files, you must read the data into your Python scripts yourself—and you must search for the data. With re ...
Hour 22. Web Programming What You’ll Learn in This Hour: Installing a web server on your Raspberry Pi Using CGI to run your Pyth ...
TABLE 22.1 apache2 Files and Folders The installation process starts the Apache web server automatically, so there’s no need to ...
FIGURE 22.1 The default Apache web server page for the Raspberry Pi. Now that the web server is running, you can try making a te ...
Save the file and then exit the editor. Copy the script2201.html file to the /var/www folder, like this: Click here to view cod ...
because you must format the output of your Python program so that the web client thinks it’s coming from a webpage document. To ...
http://localhost/cgi-bin/script2202.py You should see the results of your program appear in your web browser, as shown in Figure ...
format the output of the Python program. LISTING 22.1 Using HTML in the Python Program Output Click here to view code image #!/u ...
program! Working with Dynamic Webpages Python scripting allows you to create dynamic webpages. Dynamic webpages have the ability ...
30: conn.close() Save the file and then exit the editor. Copy the file to the /usr/lib/cgi-bin folder and assign it permissions ...
data user account. You can use the chown command to change the group owner of your files to the www-data user account: Click her ...
print('') result = 1 / 0 print('This is a test of a bad Python program') The script2206.cgi code still has the same division err ...
others on your Raspberry Pi system seeing the log files that are generated: Click here to view code image cgitb.enable(display=0 ...
TABLE 22.2 HTML Form Elements To build the form in your webpage, you must use the HTML element, which defines the action the br ...
The element in line 9 specifies the location of the Python script that you want to process the form data. The form contains two ...
Click here to view code image <input type="text" name="lname" /> The Apache server passes the data into the shell environm ...
15: <title>Form Results</title> 16: </head> 17: <body> 18: <h2>Here are the results from your surv ...
dynamic web applications using Python on your Raspberry Pi! Summary In this hour, you learned how to use Python to create dynami ...
Part VI: Raspberry Pi Python Projects HOUR 23 Creating Basic Pi/Python Projects HOUR 24 Working with Advanced Pi/Python Projects ...
Hour 23. Creating Basic Pi/Python Projects What You’ll Learn in This Hour: How to display HD images via Python How to use Python ...
«
16
17
18
19
20
21
22
23
24
25
»
Free download pdf