Here is the basic structure of the script divided into three parts. You can read any part independently by visiting the respective link above.
Database connection
We can use MySQL or SQLite database for our script. We have commented the SQLite connection string here but you can enable it and remove MySQL part. We used sqalchemy as database connection engine.
Enable the SQLite connection and disable the MySQL connection ( check the above line ).
Passing the parameters with database query.
In case of MySQL we used this
my_query="INSERT INTO mem(name,userid,password) values(%s,%s,%s)"
In case of SQLite we have to change the query like this.
my_query="INSERT INTO mem(name,userid,password) values(?,?,?)"
In all places we have to change the query part using this. No need to change any other part of the script.