Improving a Python 3 script (which has threading)

Job ID: 39229779

Budget: €30 – €250 EUR

Hi I have a short but a bit complex python 3 script.

The main loop starts a 'timeout' thread
and then calls a 'recognize' function, which exits only on quit.

I need the whole script to be restructured in order to be more easy to use:
a single function which does everything and then returns the results.

Also I need a mysql connection and some queries examples (a select and an insert).

The final result is that i'll be able to run:
1. mainFunctionWithTimeoutAndRecognize
2. mysql query
3. call mainFunctionWithTimeoutAndRecognize again
4. do a mysql query again

i'm looking for a Python guru
with lots of experience with production ready code.

You will need to make the code more clean, elegant, stable and with error handling,
consider a full day of work to put into it.

Max bid 100 euros.

Thank you.
Related categories: Python Micropython