Python Forum
Executing DOS programs within Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Executing DOS programs within Python
#1
Hello Group!
I have been a programmer for 30 years (yea an old timer) I'm new to Python and I'm working on a project to convert a software from MS DOS based to a Python framework calling DOS executable on the database server. Example would be a customer maintenance app that would call the database server for each field in the app. Below is an example. What Python class or method can I use to accomplish this? Sorry, if I'm not making myself too clear.

CUSTOMER NAME:_________ (Free form entry field)
CUSTOMER ADDRESS:______ (Free form entry field)
CUSTOMER CITY:_________ (Python calls a DOS executable with the entered data and return results)
CUSTOMER STATE:________ (Python calls a DOS executable with the entered data and return results)
CUSTOMER ZIP CODE:_____ (Python calls a DOS executable with the entered data and return results)


-Peter G
Reply
#2
Looks like you want to look at https://docs.python.org/3/library/subprocess.html
It being a DOS program shouldn't matter in this case, it could be any executable (including scripts).
Reply
#3
micseydel, So subprocess will actually go back to the server, execute the DOS executable and it will return any possible results?

I'll take a look at at https://docs.python.org/3/library/subprocess.html and get very familiar with it.

Thanks,
-Peter G
Reply
#4
No, I thought you would host this on that server. It's hard to give you a thorough answer with limited information, but if I had to do this, I suspect I'd wrap the DOS stuff on the server using subprocess and surface a REST API with the Flask framework (though you might use Django, or something else), and then the "client" application would interact with the REST server via regular HTTP calls.
Reply
#5
micseydel,
Sorry if I wasn't too clear on my objective this would be a client calling the server. The end goal is to use Django as the web framework to call/request/read/update the server. So you are recommending to use a REST API on the client and making HTTP calls to the server? So, Django has the features that I'm looking for.



btw; the database is not relational but rather a multivalued database http://downloads.openqm.com/help/mvintro.htm something like a NoSQL.

-Peter G
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Syntax error while executing the Python code in Linux DivAsh 8 1,542 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Facing error while executing below Python code ramu4651 1 5,721 Jan-26-2021, 06:40 PM
Last Post: ibreeden
  python --version yields no output, not detected by other programs ten 3 3,420 Jun-25-2020, 04:48 AM
Last Post: perfringo
  Can Cmder be used to write Python programs? newbieAuggie2019 5 5,019 Sep-30-2019, 11:24 AM
Last Post: newbieAuggie2019
  Executing python script from SQL Server agent job getting error msavoy 1 3,654 Feb-15-2019, 08:37 PM
Last Post: Larz60+
  Launching other programs from Python Truman 4 2,944 Feb-14-2019, 12:59 AM
Last Post: Truman
  Executing external Python file in background and get output in python nakiscia 0 4,957 Feb-15-2018, 02:07 PM
Last Post: nakiscia
  Issue with Python 3.X Add/Remove programs entry. WilliamM 1 3,142 Feb-08-2018, 01:54 PM
Last Post: sparkz_alot
  Trouble executing Python script NewburyPi 2 3,422 Sep-07-2017, 07:33 PM
Last Post: NewburyPi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020