码迷,mamicode.com
首页 > 其他好文 > 详细

write_to_file

时间:2019-05-02 23:36:24      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:read   python   open   threading   pen   release   write   text   close   

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

标签:read   python   open   threading   pen   release   write   text   close   

原文地址:https://www.cnblogs.com/yakoazz/p/10803526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!