zoukankan      html  css  js  c++  java
  • python

    import logging
    from logging import handlers
    
    logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
    filehandler = logging.handlers.TimedRotatingFileHandler("%s/logs/merge.log" % sys.path[0], when='D', interval=1, backupCount=10)
    filehandler.suffix = "%Y-%m-%d.log"
    filehandler.setLevel(logging.INFO)
    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
    filehandler.setFormatter(formatter)
    logging.getLogger('').addHandler(filehandler)
    
    
    from concurrent.futures import ThreadPoolExecutor
    if tm:   //tm >>list
        with ThreadPoolExecutor(max_workers=5) as executor:
            executor.map(combine,tm)
    
    
    import signal
    def handler(signalnum,frame):
         while True:
            if a > 5:
                exit(0)
            a += 1
    if __name__ == '__main__':
        signal.signal(signal.SIGTERM, handler)

    dict.pop('key')       set.remove(sas)

    sorted(dict.items(), key= lambda x : x[1])      sorted(dict.items(), key= lambda x : x[0], reverse=True)       字典按key、value排序

    continue \ pass \ break

    any() all()

    copy()  deepcopy()

    global \ nonlocal    : 全局变量 、 外部函数变量

    """ jinja2 """
    from jinja2 import PackageLoader,Environment,FileSystemLoader env = Environment(loader=FileSystemLoader('/tmp')) templates = env.get_template("test.txt") templates.render(test='888')

      

  • 相关阅读:
    第02组 Beta冲刺 总结
    第02组 Beta冲刺 (5/5)
    第02组 Beta冲刺 (4/5)
    第02组 Beta冲刺 (3/5)
    第02组 Beta冲刺 (2/5)
    第02组 Beta冲刺 (1/5)
    关于IE6中做兼容的那点事。
    一个ajax同步与异步引发的血案。
    浅谈Jquery中的bind(),live(),delegate(),on()绑定事件方式
    浅谈Dictionary用法
  • 原文地址:https://www.cnblogs.com/moonypog/p/11008065.html
Copyright © 2011-2022 走看看