当前位置: 首页 > news >正文

我国网站开发怎样用wordpress做网站

我国网站开发,怎样用wordpress做网站,聚财洋气三个字公司名字,建设asp网站视频教程一、前置说明 在自动化过程中#xff0c;经常需要在命令行中执行一些操作#xff0c;比如启动应用、查杀应用等#xff0c;因此可以封装成一个CommandExecutor来专门处理这些事情。 二、操作步骤 # cmd_util.pyimport logging import os import platform import shutil i…一、前置说明 在自动化过程中经常需要在命令行中执行一些操作比如启动应用、查杀应用等因此可以封装成一个CommandExecutor来专门处理这些事情。 二、操作步骤 # cmd_util.pyimport logging import os import platform import shutil import subprocessimport psutillogger logging.getLogger(__name__)class CommandExecutor:staticmethoddef execute_command(command):subprocess.run() 方法用于执行命令并等待其完成然后返回一个 CompletedProcess 对象该对象包含执行结果的属性。它适用于需要等待命令完成并获取结果的情况。try:result subprocess.run(command, shellTrue, capture_outputTrue, textTrue)if result.returncode 0:return result.stdout.strip()else:return result.stderr.strip()except Exception as e:return str(e)classmethoddef kill_processes_with_name(cls, name):查杀窗口名称包含 name 的所有进程支持模拟匹配try:if platform.system() Windows:# Windows系统使用tasklist和findstr命令来获取包含特定字符串的窗口进程列表command ftasklist /V /FO CSV | findstr /C:{name}output cls.execute_command(command)if output:# 遍历输出的进程列表for line in output.splitlines():# 解析进程信息process_info line.split(,)process_name process_info[0].strip()process_id process_info[1].strip()# 先尝试关父进程解决关掉uiautomatorview或appium server 之后, 会留下一个无用的cmd的窗口try:# 获取父进程parent_process psutil.Process(int(process_id)).parent()# 终止父进程CMD窗口kill_parent_command ftaskkill /F /T /PID {parent_process.pid}cls.execute_command(kill_parent_command)except:pass# 如果没有父进程则直接关闭子进程如果父进程已关闭子进程会消失也try catch 一下try:# 终止进程kill_command ftaskkill /F /T /PID {process_id}cls.execute_command(kill_command)# 记录日志logger.info(fStopped process {process_name} with ID {process_id})except:passelse:logger.info(fNo processes found with window name containing {name})else:# 其他操作系统使用wmctrl命令获取包含特定字符串的窗口列表command fwmctrl -l | grep {name}window_list cls.execute_command(command)if window_list:# 遍历输出的窗口列表for line in window_list.splitlines():# 解析窗口信息window_info line.split()window_id window_info[0]# 关闭窗口os.system(fwmctrl -ic {window_id})# 记录日志logger.info(fStopped processes with window name containing {name})else:logger.info(fNo processes found with window name containing {name})except Exception as e:logger.warning(fError: {str(e)})cmd_executor CommandExecutor() cmd cmd_executor 三、Demo验证 以关闭多开的两个夜神模拟器来测试代码顺利关闭 if __name__ __main__:import logginglogging.basicConfig(levellogging.DEBUG)print(cmd.kill_processes_with_name(夜神))欢迎技术交流
http://www.pierceye.com/news/563332/

相关文章:

  • 深圳商业网站建设模板网站建设worldpress
  • 宁波网站排名网站开发 哪家好
  • 做网站的软件工程师网站积分程序怎么建设
  • ps网站轮播图怎么做动漫制作专业的来源
  • 怎么知道一个网站是谁做的建筑认证
  • 网站关键词优化排名公司网站备案的意思
  • 怎么把qq空间做成企业网站医疗网站设计
  • 个人博客网站需求分析上海最大企业前十名
  • 兴义之窗网站怎么做网页界面设计的类别
  • 黄南州网站建设公司安徽省建设厅执业资格注册中心网站
  • wordpress布置网站教程wordpress it模板下载地址
  • 网站首页栏目设置宿州建设网站公司哪家好
  • 西安网站建设怎么接单做社交的招聘网站
  • 实训课网站开发个人小结横岗做网站
  • 网站集约化建设管理方案wordpress加cnzz统计在那里加
  • 重庆知道推广网站方法青岛网络推广的有哪些公司
  • 自己做网站服务器要多少钱特殊字体
  • 网站建设合同 协议书网站建设工具有哪些
  • 网站建设的基本条件网站建设策划案怎么写
  • 知乎网站开发用的语言郑州建设网站哪家好
  • 企业官网建站费用长沙做无痛肠镜东大医院l网站
  • 建网站资料wordpress 读书模板
  • 网站建设初学者教程成华区微信网站建设公司
  • 沈阳网站建设-中国互联商城页面
  • 成交型网站倡导公司进贤南昌网站建设公司
  • 网站跟软件有什么区别是什么点击器原理
  • 网站建设项目策划书范文杭州 网站开发公司
  • 酒店网站建设设计企业营销型网站策划
  • 用dw怎么做登录页面的网站成都微信网站建设推
  • 合肥网站建设案例美丽说网站模板