【草稿】 PYTHON 基本知识

不由自主地加分号;

熟练之后真的好用

 

  • PYTHON 变量命名规则

https://www.cnblogs.com/Maker-Liu/p/5528213.html

 

  • 一个函数中多个try except会出错
    stat_content = []
        try:
            stat_content.append(get_stat_sg_jdzsj())
        except Exception as e:
            stat_content.append('高管局交调站数据异常\n' + e)
        finally:
            stat_content
    
        try:
            stat_content.append(get_stat_gl_jdzsj())
        except Exception as e:
            stat_content.append('公路局交调站数据异常\n' + e)
        finally:
            stat_content
    
        try:
            stat_content.append(get_stat_jtb_gssjcs())
        except Exception as e:
            stat_content.append('交通部数据传输 数据异常\n' + e)
        finally:
            stat_content

     

  • python是强类型的,需要类型转换,这不是废话吗?再就是类型转换函数名,保留关键字?
  • 变量作用域好像没有java严格

 

posted @ 2019-04-12 20:55  NigelLay  阅读(152)  评论(0编辑  收藏  举报