使用Python自动化旧的DOS应用程序 [英] Automating old DOS application using Python

查看:163
本文介绍了使用Python自动化旧的DOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有办法从Python(在Windows上)自动化旧的DOS应用程序(16位,可能需要仿真器,如DOSBox)?我想将键和字符串发送到应用程序,检测DOS屏幕"的更新并获取应用程序输出.

Is there a way to automate an old DOS application (16-bit, probably needs an emulator such as DOSBox) from Python (on Windows)? I would like to send keys and strings to the application, detect updates to the DOS "screen" and get the application output.

如果DOS应用程序可以隐藏"运行,即不在任务栏中显示,那就更好了.

It would be even better if the DOS application could run "hidden", i.e., not showing in the taskbar.

注意:这不是游戏,它是一个古老的应用程序,其中的菜单中带有按1的菜单项,按2表示其他的菜单项等等,然后要求输入一些数字,然后输入显示一些结果.它是一个纯控制台应用程序.

Note: It is not a game, it is one of those old application where you are given menus with press 1 for something, press 2 for something else, etc... then it asks for some input numbers, and then it shows some results. It is a pure console application.

注2:不一定需要使用DOSBox ...可以用其他仿真器(例如Bochs)来完成

Note2: It doesn't need to use DOSBox necessarily... could be done with other emulators such as Bochs

推荐答案

我不熟悉DosBOX或它是否具有外部API.但是,对于Sun VirtualBox,有一个python API,因此,如果可以在VM上运行DOS,可以轻松地使用VirtualBox Python API来控制&使您在DOS上运行的应用程序自动化.

I'm not familiar with DosBOX or whether it has an external API. However, for Sun VirtualBox there is a python API, so if it is OK to run DOS on a VM, you could easily use the VirtualBox Python API to control & automate the application you run on the DOS.

您可以在此处下载

这篇关于使用Python自动化旧的DOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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