【草稿】 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('高管局交调站数据异常
    ' + e)
        finally:
            stat_content
    
        try:
            stat_content.append(get_stat_gl_jdzsj())
        except Exception as e:
            stat_content.append('公路局交调站数据异常
    ' + e)
        finally:
            stat_content
    
        try:
            stat_content.append(get_stat_jtb_gssjcs())
        except Exception as e:
            stat_content.append('交通部数据传输 数据异常
    ' + e)
        finally:
            stat_content
  • python是强类型的,需要类型转换,这不是废话吗?再就是类型转换函数名,保留关键字?
  • 变量作用域好像没有java严格
原文地址:https://www.cnblogs.com/NigelLay/p/10698519.html