Copy Link
Add to Bookmark
Report

NULL mag Issue 09 29 Run dos apps with python

eZine's profile picture
Published in 
null magazine
 · 3 years ago

this is a strange thing... :) i recently found some old DOS cdroms, with many goodies in them and wanted to test them under my linux machine. one way was to mount the cd inside a DOSBOX instance and browse the CD via the DOS command line.

perhaps this would be a good (perhaps the only) solution back in the days, but now i am much older and i like my GUI file manager :)

so... here we are... a python script to the rescue!!! what it does, is simple. i associate the script with the DOS .EXE files and when i double click one of them, in my file manager (pcmanfm) the script runs DOSBOX with the current folder, where the DOS program is, automatically mounted and executes it instantly.

this way, you can browse large DOS CDROM collections via your file manager very easy. hope you like it and use it.

#!/usr/bin/python3 
import os

import sys
import subprocess

dosbox_exe = 'dosbox'
dosbox_args = ['"D:"']
def run_dosbox(args):
arg = "-conf /home/user/scripts/doscfg.conf"


for cmd in args:
arg = arg +" -c "+cmd

arg = arg +" -c echo '"+str(sys.argv[1])+"'"


os.system(dosbox_exe+" "+arg)
run_dosbox(dosbox_args)
print (sys.argv)

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT