+ 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.
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
+ 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.
0
Check this Python threading basics:
http://net-informations.com/python/pro/threading.htm