Running one function without stopping another

前端 未结 3 1667
北荒
北荒 2021-01-20 03:55

How can I run a timer while asking for user input from the console? I was reading about multiprocessing, and I tried to use this answer: Python: Executing multiple functions

3条回答
  •  盖世英雄少女心
    2021-01-20 04:12

    Of course it stops running when it plays the cut_wire function because "raw_input" command reads the text and wait for the user to put the text and press enter.

    My suggestion is to check for they key press "Enter" and when then key was press, read the line. If the key wasn't press, just continue with your timer.

    Regards.

提交回复
热议问题