1、模块
# 正确的模块名
import decoder
import html_parser
# 不推荐的模块名
import Decoder
2、类名
class Farm():
pass
class AnimalFarm(Farm):
pass
class _PrivateFarm(Farm):
pass
3、函数
def run():
pass
def run_with_env():
pass
class Person():
def _private_func():
pass
4、变量名
if __name__ == ‘__main__‘:
count = 0
school_name = ‘‘
MAX_CLIENT = 100
MAX_CONNECTION = 1000
CONNECTION_TIMEOUT = 600
5、常量
MAX_OVERFLOW = 100
Class FooBar:
def foo_bar(self, print_):
print(print_)
原文:https://www.cnblogs.com/miaosha5s/p/8987344.html