:::::::::::::: PyEnv.cgi :::::::::::::: #!/usr/bin/python3 import os print ("Content-type: text/html\r\n\r\n") print ("
Environment\n")
for param in os.environ.keys():
   print ("%20s: %s\n" % (param, os.environ[param]))::::::::::::::
PyLsCgi.cgi
::::::::::::::
#!/usr/bin/python3

import os

path = '.'

files = []
# r=root, d=directories, f = files


# Import modules for CGI handling 
import cgi, cgitb 

def testa(titolo):
	print ("Content-type:text/html\r\n\r\n")
	print ("")
	print ("")
	print ("%s" %(titolo))
	print ("")
	print ("")

def piede():
	print ("")
	print ("")

testa("Lista file Py*")

for r, d, f in os.walk(path):
	for file in f:
		files.append(os.path.join(r, file))
for f in files:
	print("%s
\n" % ( f, f )) :::::::::::::: PyNomeCognome.cgi :::::::::::::: #!/usr/bin/python3 # Import modules for CGI handling import cgi, cgitb # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields first_name = form.getvalue('first_name') last_name = form.getvalue('last_name') print ("Content-type:text/html\r\n\r\n") print ("") print ("") print ("Hello - Second CGI Program") print ("") print ("") print ("

Hello %s %s

" % (first_name, last_name)) print ("") print (""):::::::::::::: PyTabellina.cgi :::::::::::::: #!/usr/bin/python3 # Import modules for CGI handling import cgi, cgitb def testa(titolo): print ("Content-type:text/html\r\n\r\n") print ("") print ("") print ("%s" %(titolo)) print ("") print ("") def piede(): print ("") print ("") # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields tab = form.getvalue('tabellina') t=int(tab) testa("Programma Tabellina") print("\n") print("") for i in range(11): print("" % (t,i,t*i)) piede() :::::::::::::: python01.cgi :::::::::::::: #!/usr/bin/python3 print ("Content-type:text/html\r\n\r\n") print ('') print ('') print ('Hello Word - First CGI Program') print ('') print ('') print ('

Hello Word! This is my first CGI program

') print ('') print ('')
TabellinaPerRisultato
%2d%2d%3d