摘要: 在setting.py文件中添加: # BASE_DIR/logs 存放日志的路径,BASE_DIR项目根目录 log_path = os.path.join(BASE_DIR, 'logs') if not os.path.exists(log_path): os.mkdir(log_path) 阅读全文
posted @ 2024-08-19 16:40 二月雪 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1、先查看系统python所在位置 [root@localhost ~]# whereis python python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /u 阅读全文
posted @ 2024-08-19 11:26 二月雪 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import sys run_system = None if sys.platform.startswith('linux'): # print('当前系统为 Linux') run_system = 'linux' elif sys.platform.startswith('win'): # p 阅读全文
posted @ 2024-08-19 11:08 二月雪 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 定义一个可以执行command的function: def execute(shell_command_str=None, timeout=None, encoding="utf-8", check=True): assert shell_command_str is not None, "Plea 阅读全文
posted @ 2024-08-19 10:22 二月雪 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 官网地址:https://www.python.org/ftp/python/ Linux系统可以下载.tgz压缩包,解压安装 Windows系统下载.exe安装程序,双击运行安装 阅读全文
posted @ 2024-08-19 09:52 二月雪 阅读(1) 评论(0) 推荐(0) 编辑