Use python to execute a windows program

Doran, Harold HDoran at air.org
Fri Sep 11 10:23:22 EDT 2009


Dear list:

My question is conceptual at the moment.

Current problem:

I have a windows-based program that reads in a file and from that file
generates data that is saved to a file.

The way we do this now is a person sits in front of their machine and
proceeds as follows:

1) Open windows program
2) Click file -> open which opens a dialog box
3) Locate the file (which is a text file) click on it and let the
program run.

This would be no problem if we did this for a small number of files.
But, we repeat this process for a few hundred files. So, the human is
sitting in front of the machine repeating this process for days until we
have all data generated.

Question:

Is it possible to write a python script that would automate this process
such that it could interact with the windows program, loop through all
of the text files in a directory rather than the human repeating this
process for days.

I have sued python quite a bit to parse XML and text files, but I have
never used it such that it would interact with a program designed to
work in windows. So, I'm not sure if such a problem is conceptually
possible.

I wish I could provide minimal commented code, but I am not sure where
to even start with this problem other than to first ask if it is
conceptually possible.



More information about the Python-list mailing list