# python-learning **Repository Path**: frinder/python-learning ## Basic Information - **Project Name**: python-learning - **Description**: 学学python吧 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-11-13 - **Last Updated**: 2022-01-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # python-learning #### 项目介绍 学学python吧 #### 变量 & 方法 命名规则 ##### 模块名 & 包名: > 小写字母,单词之间用_分割,如:`ad_stats.py` ##### 类名: > 单词首字母大写,如:`AdStats`, `ConfigUtil` ##### 全局变量名(类变量,在java中相当于static变量): > 大写字母,单词之间用_分割,如:`NUMBER`, `COLOR_WRITE` ##### 普通变量 & 普通函数 > 小写字母,单词之间用 `_` 分割,如:`this_is_a_var`, `get_name()`, `count_number()` ##### 实例变量 > 以 `_` 开头,其他和普通变量一样,如:`_price`, `_instance_var` ##### 私有实例变量(外部访问会报错): > 以 `__` 开头(2个下划线),其他和普通变量一样,如:`__private_var` ##### 专有变量: > `__` 开头,`__` 结尾,一般为python的自有变量,不要以这种方式命名,如:`__doc__`, `__class__` ##### 私有函数(外部访问会报错): > 以 `__` 开头(2个下划线),其他和普通函数一样,如:`__get_name()`