python

三目运算:  

为真时的结果 if 判断条件 else 为假时的结果(注意,没有冒号)

json序列化:josn.dumps()

json反序列化:json.loads()

多线程实现:

  thread:

  thread.start_new_thread(runTarget,(..))

  threading:

  class className(threading.Thread):

    def __init__(self..):

    def __run__(self..):

  thread=threading.Thread(target=runTarget,arg=(..))

多线程实现同步:

  thread.allocate_lock()

  threading.Lock()

  threading.RLock()

  threading.Condition()

  threading.Event()

  queue.Queue()

多线程实现主线程等待:

  threading.setprofile(lambda:(self.join()))

原文地址:https://www.cnblogs.com/burn19/p/9016323.html