python自動化常用模塊
05-22
python自動化常用模塊
來自專欄 運維
#!/usr/bin/env python# -*- coding: utf-8 -*-import subprocessimport sys, osimport commandsimport shutilimport reimport hashlib import urllibimport oss2import argparsefrom urlparse import urlparseimport timeimport randomimport jsonfrom xml.etree.ElementTree import ElementTree,Elementfrom string import replaceimport requests#--------1--------標記# 列印各種顏色的logclass Log: @staticmethod def e(msg): print(Log.red + [x]: + msg + Log.end) @staticmethod def w(msg): print(Log.yellow + [!]: + msg + Log.end) @staticmethod def i(msg): print(Log.green + [+]: + msg + Log.end) @staticmethod def t(msg): print(Log.blue + [-]: + msg + Log.end) red =