T
T
TupaBan Dev2021-12-27 04:48:53
Python
TupaBan Dev, 2021-12-27 04:48:53

Is there a way to make a loop that runs in the background while other code continues to run in python?

Let's say so -

while True:
    print('a')

b  = input("Get text")
print(b)

It is necessary for me that all the code after and before the cycle continues to work, and does not wait for the end of the cycle, but continues to work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lillipup, 2021-12-27
@TupaBan

python-3.ru/page/import-threading

C
comandante_ktc, 2021-12-27
@comandante_ktc

asyncio to help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question