我可以在运行时从脚本打开应用程序吗? [英] Can I open an application from a script during runtime?

查看:27
本文介绍了我可以在运行时从脚本打开应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在运行时用 Python 打开任何类型的应用程序?

I was wondering if i could open any kind of application in Python during runtime?

推荐答案

假设您使用的是 Windows,您将使用以下命令之一.

Assuming that you are using Windows you would use one of the following commands like this.

subprocess.call

import subprocess
subprocess.call('C:\\myprogram.exe')

os.startfile

import os
os.startfile('C:\\myprogram.exe')

这篇关于我可以在运行时从脚本打开应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆