DAY 6 | 29 August | 6. Python 3 API and CGI
- Integrating html with python and building a interactive web page. (with python as a backend)
- By default type of input box is 'text', can change it to button, radio, checkboxes.
fieldstorage()
is used to get input from client through web url,fieldstorage()
- get value,getvalue()
- retrieve the data from the field.- All the browsers have HTML interpreter, web servers never runs the code. It sends the code to client browser, browser runs all the html tags & then display it.
- Tags bold -
<b>
, underline -<u>
, break -<br>
, header -<h>
. - We can use a variable to store the input data & can send it to any server through url using http protocol. Form decides where to take the data
<form action= 'server_url'>
. - Radio box acts as a variable, Check box acts as an list. I have explained it clearly here
DAY 7 | 30 August | 7. Python 3 API and CGI
- About the ARTH and INIT programs.
- To to interact with OS
CLI
,GUI
,WebUI
andMobileUI
. curl url
which runs the page and shows the output in the cmd prompt.- To see the header of a file we can use
curl -I url
. - Redirection - When we search with the link
http://www.gmail.com/
it automatically redirects to actual urlhttps://mail.google.com/mail/u/0/
which is hidden at the header filedlocation: url
. - Learn more about the concept of new line - the browser understands that whatever is before the new line is a header and after it is the body.
- Query string is a part of the url where we can see the value which is assigned to a variable
http://ip/cgi-bin/f.py?x=cal
herex=cal
.