+ 1

How to make code run in the background of another

I am new to python and was wondering, how can I make the user be inputting things and such, while something else happens in the background? Like how on Windows you work, but other programs do things in the background, except in my case on a much simpler level, like some sort of loop.

18th Oct 2018, 7:36 PM
Rowan
Rowan - avatar
3 ответов
+ 3
Here are some posts / codes related to multiprocessing, threading and the global interpreter lock (GIL). I'm pulling links forward here too because I've had some disappear (possibly people leaving / deleted accounts). Grok the GIL: How to write fast and thread-safe Python https://opensource.com/article/17/4/grok-gil I read recently that Python dev's may be trying to do away with the GIL (not sure how that's going). https://www.sololearn.com/Discuss/378985 https://www.sololearn.com/Discuss/741521 https://code.sololearn.com/cPyfXZGRo5sr https://www.sololearn.com/Discuss/771827
18th Oct 2018, 9:28 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
You are asking about threading. Python gives you an opportunity to create multithreadin applications (https://docs.python.org/3/library/threading.html#module-threading), thouhg imho it is not for the beginner's level.
18th Oct 2018, 8:29 PM
strawdog
strawdog - avatar
21st Mar 2019, 11:35 AM
rahul kumar
rahul kumar - avatar