Python Forum
Simple URL Example – Get Method
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple URL Example – Get Method
#5
Ok, so I installed flask. And then I wrote this in IDLE:
#!/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")
print ()
print ("<html>")
print ("<head>")
print ("<title>Hello - Second CGI Program</title>")
print ("<head>")
print ("<body>")
print ("h2>Hello %s %s</h2>" % (first_name, last_name))
print ("<body>")
print ("</html")
This is the supposed output:
https://ibb.co/J2P7qkT
This is the actual output:
https://ibb.co/gW6rbqp
Reply


Messages In This Thread
Simple URL Example – Get Method - by whois1230 - Nov-16-2020, 07:40 PM
RE: Simple URL Example – Get Method - by ndc85430 - Nov-16-2020, 07:53 PM
RE: Simple URL Example – Get Method - by snippsat - Nov-18-2020, 07:02 PM
RE: Simple URL Example – Get Method - by whois1230 - Nov-19-2020, 06:10 PM
RE: Simple URL Example – Get Method - by ndc85430 - Nov-19-2020, 06:44 PM
RE: Simple URL Example – Get Method - by snippsat - Nov-19-2020, 07:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best Method for simple GUI? PythonAndArduino 4 3,652 Nov-17-2017, 06:22 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020