How to run a function so it works also when other functions work?

寵の児 提交于 2019-12-29 09:27:08

问题


For ex:- Below I have four different functions and they do all different things on a particular domain. Now What I want is to run crawler to work behind these other functions work so my code will move faster.

crawler(domain)
f2()
f3()
f4()

How can I? I have tried this:-

th = threading.Thread(crawler)
th.start()
f2()
f3()
f4()
th.join()

Is this code can be considered efficient and effective?

来源:https://stackoverflow.com/questions/46642992/how-to-run-a-function-so-it-works-also-when-other-functions-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!