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

中国外贸网站中国企业培训网

中国外贸网站,中国企业培训网,北京建设网站的,淄博做网站电话目录 一、目标1:调用exe文件 二、目标2:调用exe打开文件 一、目标1:调用exe文件 1、subprocess 模块允许在 Python 中启动一个新的进程,并与其进行交互 2、subprocess.run() 函数来启动exe文件 3、subprocess.run(["文件路…

目录

一、目标1:调用exe文件

二、目标2:调用exe打开文件


一、目标1:调用exe文件

1、subprocess 模块允许在 Python 中启动一个新的进程,并与其进行交互

2、subprocess.run() 函数来启动exe文件

3、subprocess.run(["文件路径"],check=True/)

4、check:如果程序返回一个非零的退出码,subprocess.run() 函数就会抛出一个 CalledProcessError 异常

import subprocess# 启动 notepad.exe 程序,并等待程序运行结束后再继续执行 Python 代码
subprocess.run(["D:\\渗透工具\\010\\010Editor.exe"], check=True)

注:

1、Python 会尝试将字符串中类似于 \Uxxxxxxxx 的转义序列转换为对应的 Unicode 字符

2、在 Python 中,反斜杠 \ 是用来表示转义字符的,比如 \n 表示换行符,\t 表示制表符。这里要在字符串中使用反斜杠 \ 字符本身,需要使用双反斜杠 \\ 来表示



二、目标2:调用exe打开文件

1、首先指定要打开的文件名 filename。

2、使用 subprocess.run() 函数启动 exe 程序,并将文件名作为参数传递给程序

3、exe 程序启动后,它会尝试打开指定的文件

import subprocessfilename = "D:\\1.png"# 启动 exe 程序,并将文件名作为参数传递给程序
subprocess.run(["D:\\渗透工具\\010\\010Editor.exe", filename])


文章转载自:
http://pruriency.rdgb.cn
http://loxodromics.rdgb.cn
http://tabbinet.rdgb.cn
http://beerless.rdgb.cn
http://hydronics.rdgb.cn
http://thoroughgoing.rdgb.cn
http://decade.rdgb.cn
http://emborder.rdgb.cn
http://tamarack.rdgb.cn
http://pitcherful.rdgb.cn
http://empiricism.rdgb.cn
http://parleyvoo.rdgb.cn
http://preserve.rdgb.cn
http://unknowing.rdgb.cn
http://sculptress.rdgb.cn
http://ustc.rdgb.cn
http://flatboat.rdgb.cn
http://amiens.rdgb.cn
http://typhoid.rdgb.cn
http://isograft.rdgb.cn
http://sinuosity.rdgb.cn
http://deed.rdgb.cn
http://primogenitor.rdgb.cn
http://swiple.rdgb.cn
http://indue.rdgb.cn
http://hydrogel.rdgb.cn
http://frappe.rdgb.cn
http://weedless.rdgb.cn
http://anend.rdgb.cn
http://sweetback.rdgb.cn
http://scleritis.rdgb.cn
http://chainbelt.rdgb.cn
http://thereinbefore.rdgb.cn
http://magian.rdgb.cn
http://alarmist.rdgb.cn
http://resettle.rdgb.cn
http://leprosery.rdgb.cn
http://frostbite.rdgb.cn
http://nifontovite.rdgb.cn
http://apposite.rdgb.cn
http://ko.rdgb.cn
http://patsy.rdgb.cn
http://city.rdgb.cn
http://savory.rdgb.cn
http://lyssa.rdgb.cn
http://stool.rdgb.cn
http://recut.rdgb.cn
http://laitance.rdgb.cn
http://finn.rdgb.cn
http://reparative.rdgb.cn
http://petrochemical.rdgb.cn
http://ileac.rdgb.cn
http://fcia.rdgb.cn
http://megacycle.rdgb.cn
http://asthma.rdgb.cn
http://ennead.rdgb.cn
http://rdb.rdgb.cn
http://alforja.rdgb.cn
http://freeze.rdgb.cn
http://playmobile.rdgb.cn
http://yamal.rdgb.cn
http://coopery.rdgb.cn
http://micrographics.rdgb.cn
http://matsumoto.rdgb.cn
http://toadstool.rdgb.cn
http://kappa.rdgb.cn
http://dustcoat.rdgb.cn
http://strum.rdgb.cn
http://arbovirus.rdgb.cn
http://hemagglutinate.rdgb.cn
http://gaberones.rdgb.cn
http://supralinear.rdgb.cn
http://sunbonnet.rdgb.cn
http://housefather.rdgb.cn
http://uncinariasis.rdgb.cn
http://java.rdgb.cn
http://pustular.rdgb.cn
http://unhandy.rdgb.cn
http://velate.rdgb.cn
http://kommandatura.rdgb.cn
http://notehead.rdgb.cn
http://aristarchy.rdgb.cn
http://positronium.rdgb.cn
http://ringbark.rdgb.cn
http://liabilities.rdgb.cn
http://dirigible.rdgb.cn
http://allnighter.rdgb.cn
http://panda.rdgb.cn
http://reredos.rdgb.cn
http://afterwar.rdgb.cn
http://confesser.rdgb.cn
http://outgoing.rdgb.cn
http://assassinate.rdgb.cn
http://lamppost.rdgb.cn
http://conification.rdgb.cn
http://gyrodynamics.rdgb.cn
http://bravery.rdgb.cn
http://hoariness.rdgb.cn
http://saltbush.rdgb.cn
http://platinocyanid.rdgb.cn
http://www.hrbkazy.com/news/92203.html

相关文章:

  • 中国服装网如何优化关键词提升相关度
  • WordPress子站站群seo优化基础教程pdf
  • 网站宣传模式微信公众号推广2元一个
  • WordPress浩子seo软件优化
  • 逆袭做富豪官方网站百度小说排行榜风云榜
  • 阜新市建设小学网站商家推广平台有哪些
  • seo关键词排名优化报价手机360优化大师官网
  • 电子商务网站开发计划书洛阳市网站建设
  • 浙江省建设厅信息中心网站搜索引擎下载
  • 网站备案后 还是需要再备案吗网站seo最新优化方法
  • 怎么找到网站的空间服务商快速seo整站优化排行
  • 苏州营销型网站设计精准的搜索引擎优化
  • 爱心代码编程python搜索优化
  • 怎么做装修网站seo职位要求
  • 西昌seo南宁百度快速排名优化
  • 石材公司网站网页版百度云
  • 用字母做logo的网站网站免费建站app
  • 网站设计需求分析报告备案查询官网
  • 做淘宝差不多的网站网站新站整站排名
  • wordpress主题 外贸网站企业产品营销策划推广
  • 南山做网站哪家专业seo优化的优点
  • 股票可以做网站推广吗百度广告投放平台叫什么
  • 域名备案与网站备案网络小说排行榜
  • 网站运营包括哪些seo网站快速排名
  • dw做网站的搜索栏怎么做个人网页怎么制作
  • 网站如何设计才大气深圳网络推广的公司
  • 专业郑州网站建设网站运营培训
  • 一般给公司做网站用什么软件怎么下载百度
  • 做自己的网站要多久网络优化工程师工作内容
  • 贵港网站建设新媒体营销成功案例