Running Two Pieces Of Code At The Same Time

What if you wanted to run a piece of code when another piece of code is run. How do you do that?

Do you mean run two independent functions at the same time?
What are you trying to do?

Like this?
https://stackoverflow.com/questions/18864859/python-executing-multiple-functions-simultaneously

I mean something like that. I’ve heard of multithreading and what is it? I came up with this idea because I was wondering that if you could have a game and in the background something is happening while something else.

I think that that conversation is about Python 2 not Python 3.

Ah, okay. I don’t know much about that outside what I found online.

https://www.geeksforgeeks.org/multithreading-python-set-1/

As for P2 vs P3–there’s not that much difference. The concepts are still the same.