Python - run two commands at the same time

后端 未结 4 446
生来不讨喜
生来不讨喜 2021-01-07 08:05

I am new to Python and am having trouble with this piece of code:

while true:
   rand = random.choice(number)
   print(rand)             
   enter_word = inp         


        
4条回答
  •  天命终不由人
    2021-01-07 08:27

    you have to run two concurrent threads at the same time in order to get rid of such blocking. looks like there are two interpreters that run your code and each of them executes particular section of your project.

提交回复
热议问题