Giving input and output files for batch processing?

I have more than 100 .txt files in a directory, that I want to run the same python script for each one of the files. Right now I have to type a similar command over 100 times because there is a slight variation for each command because the input and output file names are different. I was wondering if this could done automatically.

I couldn't test this because I don't have the input files nor do I have all the third party modules installed that you do. However it should be close to what you should do, as I was trying to explain in the comments.