Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve).
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. A good way to demonstrate this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the [FAQ] and [ask].
Welcome to Stack Overflow! You seem to be asking for someone to write some code for you. Stack Overflow is a question and answer site, not a code-writing service. Please [see here](http://stackoverflow.com/help/how-to-ask) to learn how to write effective questions.
Please consider revising the code sample you posted in this question. As it currently stands, its formatting and scope make it hard for us to help you; here is a [great resource](http://stackoverflow.com/help/mcve) to get you started on that. -1, don't take it the wrong way. A down vote is how we indicate a content problem around here; improve your formatting and code sample and I (or someone will) gladly revert it. Good luck with your code!
If you need to add additional information to your question then you should [edit](http://meta.stackexchange.com/a/21789/204922) your original question. Please only use the "Post Answer" button if you have found an answer to your question.
Hello and welcome to StackOverflow. Please take some time to read the help page, in particular [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). (http://stackoverflow.com/help/mcve).
Unfortunately this post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions that lack sufficient information to diagnose the problem.* Please edit your post accordingly to add sufficient detail so that people may help you.
This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions about a problem that can no longer be reproduced or that was caused a simple typographical error.* While your question may be technically on-topic here, these questions are often resolved in a manner unlikely to help future readers.
This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions asking for code must demonstrate a minimal understanding of the problem being solved.* Please include your expected results, your attempted solutions, and why they didn't work. Please see the [Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922) for more details.
This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.*
This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming.* Your question may be better suited for [Super User](http://superuser.com/)
This post appears to be [off-topic](http://stackoverflow.com/help/on-topic) as per *Questions on professional server, networking, or related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools.* Your question may be better suited for [Server Fault](http://serverfault.com/) or the [Database Administrators Stack Exchange](http://dba.stackexchange.com/)