In Python specifically, how do variables get shared between threads?
Although I have used threading.Thread before I never really understood or saw examp
Just like in every other language, every thread in Python has access to the same variables. There's no distinction between the 'main thread' and child threads.
One difference with Python is that the Global Interpreter Lock means that only one thread can be running Python code at a time. This isn't much help when it comes to synchronising access, however, as all the usual pre-emption issues still apply, and you have to use threading primitives just like in other languages. It does mean you need to reconsider if you were using threads for performance, however.