I don't get what you are actually willing to do. But form these lines said by you ,
"How would I make these two functions run together"
. I understand you are willing to implement Threading in your application.
Here is how you implement thread for two functions and will make the two functions run together.[Example]
from threading import Thread
def function1():
for i in range(100):
print("Function 1 is executing")
def function2():
for i in range(100):
print("Function 2 is executing")
t = Thread(target=function1)
t.start()
t1 = Thread(target=function2)
t1.start()
and the output will be like this
Function 2 is executingFunction 1 is executing
Function 2 is executingFunction 1 is executing
.
.
.
Function 2 is executingFunction 1 is executing
NOTE: Multi-threading satisfies your need but multi-threading is entirely different from multi-processing. This threaded application(shown in the example above) performs only a single task at a time. It is your CPU which allocates time for both the threads to run together., I mean time is divided and each task is performed. At a particular time only one thread will be executed. It looks like your program is performing multiple tasks at a same time but it is not.