Automating old DOS application using Python

对着背影说爱祢 提交于 2020-01-04 04:00:51

问题


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.

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

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.

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


回答1:


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.

You can download the VirtualBox SDK here



来源:https://stackoverflow.com/questions/1744796/automating-old-dos-application-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!