What happened to thread.start_new_thread in python 3

前端 未结 2 1373
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 03:14

I liked the ability to turn a function into a thread without the unnecessary line to define a class. I know about _thread, however it appears that you are not supposed to us

2条回答
  •  盖世英雄少女心
    2020-12-09 03:59

    threading.Thread(target=some_callable_function).start()
    

    or if you wish to pass arguments,

    threading.Thread(target=some_callable_function,
            args=(tuple, of, args),
            kwargs={'dict': 'of', 'keyword': 'args'},
        ).start()
    

提交回复
热议问题