cost 69 ms
如何获取外部可执行文件的输入和 Output? - How to get the Input and Output of an external Executable?

我想深入挖掘自动化,但没有找到任何关于从任何可执行文件获取信息的信息。 我想要的是通过 Python 启动一个 exe,这样 python 就可以看到当我按下一个按钮或在该外部程序中执行其他操作时会发生什么。 有了给定的数据,我想自动化外部程序并给它数据来按下它自己的按钮。 就像 silenium ...

在进程 python 中运行 function 时捕获实时 `stdout` 和 `stderr` - Capture real time `stdout` and `stderr` when run a function in a process python

我有一个 python function 并希望将它作为一个单独的进程运行,并带有multiprocessing package。 然后使用以下脚本将其作为单独的进程运行: 现在,我需要捕获上述过程的实时stdout和stderr 。 有没有什么办法像: 但是我需要传递 function 而不是使 ...

如果以不同的方式调用相同的 python 命令需要不同的时间 - Same python commands take different time if called in different ways

我有一些数据(字节)表示来自后台运行的可执行文件的 pyzmq 套接字的 png 图像。 我使用以下命令将它们转换为 numpy 数组decoded = np.asarray(im.open(io.BytesIO(data))) 当我从命令行执行此操作时,这行代码的运行时间不到一毫秒(也通过 pyt ...

如何在不引用当前 virtualenv 的情况下在子进程中运行 poetry install? - How do I run poetry install in a subprocess without reference to the current virtualenv?

我正在用我们拥有的命令行工具编写一些自动设置代码。 此命令行工具随 poetry 一起安装,因此当有人调用命令行工具时,它来自 poetry 设置的虚拟环境。 我试图调用的命令是poetry install for another directory 。 我希望此命令为其他目录创建一个新的 vir ...

ssh-keygen 为空 output,在 macOS Ventura 13.1 上的 python3.10 中带有 subprocess.run 和 os.system - ssh-keygen empty output with subprocess.run and os.system in python3.10 on macOS Ventura 13.1

我一直在尝试 output 使用 python 和“子进程”库从 ssh-keygen (CLI) 生成的签名公钥。 我还尝试了具有相同结果的“os”库。 我真的很想了解为什么它没有按照我的意愿进行:像我期望的那样在屏幕上显示“ssh-keygen -Lf {keyfile}”的 output。 ...

Python 子进程调用 output 超时 - Python subprocess call with output and timeout

总结:我想从 Python(3.6 版)启动一个外部进程,非阻塞地轮询结果,并在超时后终止。 详细信息:有一个带有 2 个“坏习惯”的外部进程: 它在未定义的时间后打印出相关结果。 它打印出结果后不会停止。 示例:也许以下简单应用程序大部分类似于要调用的实际程序( mytest.py ;源代码不可用 ...

使复杂系统命令适应 subprocess.run() - Adapting a Complex System Command to subprocess.run()

我正在编写一个 Python3 脚本,它必须在我的 Ubuntu 20.04.5 LTS 机器上运行这个系统命令: 当我手动将此命令粘贴到服务器的命令行时,该命令运行良好。 现在我需要我的 Python 脚本来执行它。 感谢这样的帖子,我相信subprocess.run()命令应该在这里工作。 ...

Python - 带有 creationflags (0x00000008) 的子进程 - 进程结束后如何获得 output? (视窗) - Python - subprocess with creationflags (0x00000008) - How to get output after process ends? (Windows)

我写了一个 Python 脚本来运行属于第 3 方程序的终端命令。 这个脚本基本上成功地运行了命令。 但是,我想打印 output 但process.stdout.readlines()打印了一个空列表。 由于第 3 方程序的终端命令,我需要使用 creationflags 运行子进程。 我也试过 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM