write_to_file

Posted yakoazz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了write_to_file相关的知识,希望对你有一定的参考价值。

mutex = threading.Lock()


def write_to_file(file_name,text):
    mutex.acquire()
    a = open(file_name,‘a‘)
    a.write(text+"\n")
    a.close()
    mutex.release()

  

以上是关于write_to_file的主要内容,如果未能解决你的问题,请参考以下文章