Jul-04-2018, 05:07 PM
I connected the local host and when I click the link (timing data) from my browser i get plain python code displayed in my page.
Need to know how CGI is running python file.
code:
<p>
For now, all that you'll find here is my athlete's <a href="/webapp/cgi-bin/generate_list.py">timing data</a>. Enjoy!
</p>
Output:
import cgi
import athletemodel
import yate
import glob
data_files = glob.glob("data/*.txt")
athletes = athletemodel.put_to_store(data_files)
print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("generate_timing_data.py"))
print(yate.para("Select an athlete from the list to work with:"))
for each_athlete in athletes:
print(yate.radio_button("which_athlete", athletes[each_athlete].name))
print(yate.end_form("Select"))
print(yate.include_footer({"Home": "/index.html"}))
Need to know how CGI is running python file.
code:
<p>
For now, all that you'll find here is my athlete's <a href="/webapp/cgi-bin/generate_list.py">timing data</a>. Enjoy!
</p>
Output:
import cgi
import athletemodel
import yate
import glob
data_files = glob.glob("data/*.txt")
athletes = athletemodel.put_to_store(data_files)
print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("generate_timing_data.py"))
print(yate.para("Select an athlete from the list to work with:"))
for each_athlete in athletes:
print(yate.radio_button("which_athlete", athletes[each_athlete].name))
print(yate.end_form("Select"))
print(yate.include_footer({"Home": "/index.html"}))