Question
----------Python Raspberry Pi code----------- ------------In Raspberry Pi terminal command prompt---------------- Change the file and folder ownership of the Apache Webserver html folder and index.html file
----------Python Raspberry Pi code-----------
------------In Raspberry Pi terminal command prompt----------------
Change the file and folder ownership of the Apache Webserver html folder and index.html file by:
$ cd /var/www/html
$ sudo chown pi: index.html
$ cd ..
$ sudo chown pi: html
---------In Thonny Python IDE-------------
import sys
import os
import time
import datetime
import pytz
import subprocess
Then=datetime.datetime.now(pytz.utc)
TempString=str(then.astimezone(pytz.timezone(US/Eastern)))
TempString=TempString+
print(The following is the result of the Terminal Command $finger)
p=subprocess.Popen(finger, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
For line in p.stdout.readlines():
print(line)
TempStringF=line
retval=p.wait()
print(The following is the string stored in TempStringF)
print(TempStringF) print(Opening WWW Index File for Writing)
file=open(/var/www/html/index.html,w)
file.write(TempString)
file.write(str(TempStringF))
file.close()
print(Index file has bee updated and closed)
-------------------------------------------
Open index.html and add your name. Clean up the display of the index.html web page so that it looks as if you typed the following at the terminal prompt.
$ finger
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started