Python And MySQL

How To Make A Select Drop Down List In Python

(Login: demo, 123) In the above example, I demonstrate what a drop down list on a Python webpage looks like. Here’s the code: #!/usr/bin/python print “Content-type: text/html\n\n” print “” print “” print “Select Quiz Dropdown Example” print “” print “” print “” print “” print “” #GLOBAL VARIABLES USERNAME = ‘admin’ PASSWORD = ‘pwd’ DB […]

Continue Reading

Python Project – Online Quiz Management – Adding Quizzes

Now it’s time to add some functionality to add quizzes. So first we have to make a MySQL table to hold the main quiz text: (view structure after the table is created) Now this is where the questions for the quiz will be entered. Please note, that this is a “parent/child” type database setup, the […]

Continue Reading

Python Project – Online Quiz Management – Add Edit Delete

The following code will allow you to: -Enter (insert) new quizzes -Modify (Update) existing ones -Delete quizzes you don’t want. (Click image to see it in action – login with “demo” and “123”) Click here for the main project link #!/usr/bin/python print “Content-type: text/html\n\n” print “<html>” print “<head>” print “<title>Enter Quizes</title>” print “</head>” print “<body>” […]

Continue Reading

Python Project – Login Form

This login form is probably going to be used for many projects, so it’s in a post all by itself. #!/usr/bin/python print “Content-type: text/html\n\n” print “<html>” print “<head>” print “<title>Login To Online Quiz</title>” print “</head>” print “<body>” #GLOBAL VARIABLES USERNAME = ‘username’ PASSWORD = ‘password’ DB = ‘mysql-database’ import MySQLdb import os #import requests #this […]

Continue Reading

Python Project – Online Quiz Management

I am going to be implementing some Python projects with a browser front end (obviously since that’s what this domain is called), I am going to be focusing on the core functionality, not really the aesthetics. You can always use some stylesheets (CSS) to make it look pretty. I am just concerned with the fact […]

Continue Reading

Adding An Application Switchboard

We want to direct “traffic” to where we want them to go, so we are going to add a navigational component called a “switchboard”. Any page that’s called index.htm or index.php is going to show up first, when someone enters that URL. That looks more professional than just seeing a list of files in that […]

Continue Reading

Use The Data Entry Form To Have Python Insert Data Into MySQL

In our previous post we showed how to enter data into a data entry form and display the values on the screen. In this post, we will continue the concept, but we are actually going to enter it into our MySQL database. Here are a few changes we are making: Python Global Variables In A […]

Continue Reading

How To Simply Connect Python To MySQL On Your Site

Nearly all the visitors to this website are interested in how to integrate the python programming language into their website. We are going through a website I originally build in PHP and MySQL, and reconstruct the site using python and MySQL. Interesting. This will give some good insight into python concepts. In this post, I […]

Continue Reading