使用 black 库将已经写好的python代码进行格式化 安装 pip install black 在对应路径的终端中输入 black 文件名.py black hello.py 如果觉得文章不错,可以分享给其他人哟~